Announcement

Collapse
No announcement yet.

JSON request causes event to trigger even if triggering device doesn't change.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    JSON request causes event to trigger even if triggering device doesn't change.

    I'm trying to keep a device status change (made via JSON) from triggering an event with every JSON request, even when there is no status change:

    A plugin I'm building sends a JSON request to set a devicestatus in HS, like this (which works fine):
    Code:
    http://192.168.1.1/JSON?request=setdevicestatus&ref=' + device_status + '&value=' + str(m) +'&source=SOURCE
    The device it controls (device_status) takes on a few values, and this is checked: "last change time updates on status change only". Indeed it only shows last change time as expected.

    But, a GUI event that is triggered from a change in devicestatus is always triggered. That event is set like this.:

    Click image for larger version  Name:	Screenshot 2022-01-20 231905.jpg Views:	0 Size:	21.7 KB ID:	1522190
    Generally in HS if the status doesn't change, even if set, there is no trigger. In this case whenever device_status is set to "idle" (aka "not equal to Sweeping"), it is triggered. Is there another parameter in the JSON request to prevent this? Or is there another event trigger that is more appropriate?

    #2
    Click image for larger version

Name:	image_109110.jpg
Views:	507
Size:	55.6 KB
ID:	1522195 I just learned it's probably better to set the triggered event with a conditional like this:

    Comment

    Working...
    X