I recently noticed that the Android app has Tasker integration and can send the next alarm time to an item so I am trying to use these features for my Sleep as Android integration. First problem I ran into was getting my alarm time into an item. I tried the “Send Alarm Time” option but it sends epoch millis not a parable DateTime string as I would have expected. Currently I use AutoAlarm and send a string to a proxy item, but the app can’t read Tasker variables so that’s out too.
Is this the expected behaviour for the app? From a user standpoint it’s not what I would expect.
Log for information:
10-17 17:50:00.802 16880 24878 E ItemUpdateWorker: Error updating item 'saa_mike_alarm_time' to value 1571386500000. Got HTTP error 400
For the time being I will modify my proxy item rule parse millis instead of a string, but I was hoping to drop this rule entirely.
It’s currently the expected behavior, but changing that to update DateTime instead of Number items and sending the appropriate format for that should be reasonably easy.
@mueller-ma Was there a specific reason for the current behavior?
I think a Number item should get millis, a String or DateTime should get the ISO formated time string, and anything else should throw an error in the app and not try to send the update.
Link me an apk if you want me to test anything.
Side note: the wording is not clear and there is no option to choose, does the Tasker integration update or command the item?
Fair enough when looking at it purely from the Java side, epoch millis is the goto for most languages.
Perfect, that is what I need for my current usage. Though I did find that out through experimentation with my Sleep as Android items last night!
Another thing I noticed in my tests last night, it does not consider the local/remote connection when making the HTTP requests. This is something that I have not gotten around to putting into Tasker, but now on Android 10 they explicitly support HTTP Basic Auth where before you had to Base64 encode username:password into a header manually. My nginx is configured to allow access to 192.168.0.0/24 without password but anyone else must use basic auth. Again, I was expecting the Tasker integration to take my local/remote settings in the openHAB app into consideration but it does not seem to.
Splendid! I’ve subscribed to those threads and the one for DateTime receivers. Let me know here or there when you have a build if you want me to test it.