I've seen a few threads on this in the past, but found nothing that actually resolved the issue. Basically here's what I have. I've found I can control a device (a device that has both status and control set for it's values) using a single line of json:
That will properly update the device status, it's last changed time, and hstouch, and any triggers that trigger on that device status will trigger. I can also do the same with 'controldevicebyvalue'.
However, if the status value that I'm trying to update is a status-only value (or if the device is a status-only device), the above line errors. With much digging I've found I can at least update the status and get hstouch to update using two commands:
followed by:
This will update the device status and update hstouch. HOWEVER, it does not appear to update the last changed time for the device, and any triggers that trigger on that device do NOT trigger.
So far I have not found a way around this. I have a bunch of hidden virtual devices for which I'd like to be able to have as status-only and change via json, and have triggers trigger off of those changes. The only thing I've been able to do for now is to make them non-status-only, which works. But I shouldn't have to.
Anyone know a better way?
regards,
Paul
Code:
http://home.fielding.ca/JSON?&request=controldevicebylabel&ref=884&label=Home
However, if the status value that I'm trying to update is a status-only value (or if the device is a status-only device), the above line errors. With much digging I've found I can at least update the status and get hstouch to update using two commands:
Code:
http://home.fielding.ca/JSON?&request=setdeviceproperty&ref=563&property=NewDevValue&value=100
Code:
http://home.fielding.ca/JSON?&request=setdeviceproperty&ref=563&property=ChangedValueORString&value=TRUE
So far I have not found a way around this. I have a bunch of hidden virtual devices for which I'd like to be able to have as status-only and change via json, and have triggers trigger off of those changes. The only thing I've been able to do for now is to make them non-status-only, which works. But I shouldn't have to.
Anyone know a better way?
regards,
Paul
Comment