I’m trying to see if I can control devices on HomeSeer via post but not sure where you would put this code or how to do this, hoping for some feedback. This is from HomeSeer, I understand what it’s saying but can’t figure out where in HA I would put it. I’m trying to have it so that if I have a virtual device or switch in HA, turning it on or off sends a JSON to HomeSeer to turn a device there on or off.
POST requests
JSON post requests can be used to control devices. The following request will turn a device on using the device value. In this example, a value of 255 will turn this device on:
Post data: {‘action’ : ‘controlbyvalue’, ‘deviceref’ : ‘3570’, ‘value’ : ‘255’}
Url: ip_address/JSON
To control a device by label. In this case the label “On” will turn the device on:
Post data: {‘action’ : ‘controlbylabel’, ‘deviceref’ : ‘3570’, ‘label’ : ‘on’}
To run the actions of an event:
Post data: {‘action’ : ‘runevent’, ‘group’ : ‘GROUPNAME’, ‘name’ : ‘EVENTNAME’}