Hello,
Been using hubitat awhile now and love it
I have
C7
platform version - 2.3.6.146
I have seen several posts on getting battery percentage into HE. I have tried doing http with Tasker and Maker api. I have been using Tasker for 5 years so know it very well. Maker API very new and no success yet. When I run the task in tasker I get an error. "Device not found or error". Does the phone need to be rooted ? Does there need to be a port noted ?
this is what I used in tasker - (the xs would have actual IP)
At the moment Tasker is giving me a different error I looked at battery percentage and check what it was in tasker so changed it to %bi_level. This changed error to error 400 in tasker
The structure of the Maker API call looks ok at a glance. Is your Maker API app in HE app 489? This will appear in the URL in a browser if you open Maker API.
In the maker app under select devices. Do I select the phone that I am trying to get percentage from ?
In the URL to post device events I have 753 on the very end.
New to using Maker API so not sure my settings are correct.
Unfortunately I don't have much more time to assist, but what @jtp10181 was referring to earlier was to check that 753 in your original maker API URL is the device I'd of the device in HE. On the page where you looked at the set battery command and battery percentage, check the URL in the address bar, this should include the device id.
Might be a day or two before I can take a proper look. Hopefully someone else can help you out in the meantime. Otherwise, my tasker project should hopefully make this a little easier.
Just to make sure, this isn't at the very end, I assume, if the Device Id is 753, then it was in the correct spot in your original URL you posted, as were other elements.
Yes this is correct. Maker API has two main use cases, well three if you want to include modes... In terms of devices you are able to both retrieve details about the device (from the Current States in the Device Detail page) and issue commands, also displayed at the top of the Device Detail page. And so you are right, the list of selected devices is for any device where you want to do either of those two things, retrieve status information or issue a command. In this case, the command is to set the battery reading.
One thing to check is that you have configured the METHOD correctly in Tasker for the HTTP Request, making sure it is set to a GET method in this case.
If you could post a screenshot of your tasker setup that may help. I am wondering whether you are not using a battery level changed event as the trigger in the profile, in which case I don't expect the BATT variable would be available.
Lastly, in case it hasn't been mentioned already... try issuing the HTTP call by posting it into a browser address bar and seeing if you can alter the battery level that way.
Just wanted to post. Simon helped me fix it and I am very grateful Thanks again Simon you are amazing !!!. The problem was in tasker mainly the battery variable I was using. I had requested the battery info in tasker which for current level was %bi_level. I changed this to %BATT and it worked.
Also a second note in the release of the driver Simon had the device, command, and secondary in brackets so when you put in your info don't use brackets. I had tried with and without. My main problem was the battery percentage. Also my Maker app was not setup correctly. I had to add virtual device to list / select it and secondly remove url to post to.
Just thought I'd share for anyone trying to get this to work.
Have a great day and sure love this community