I’m switching from Smart Things to Home Assistant, and figured I’d post my current RESTful switch integration to let you control the LED lights on the sand table from home assistant. I haven’t found anything yet that can control a “dimmable” switch through REST yet, so the LED will always remain at a constant brightness (100 here – a little less than half. 255 is max brightness). I would like to implement all the features and controls of the sand table in HA, but I’m still a newbie, so this at least lets me shut the light off at night.
Obviously replace SANDBOT_IP_ADDRESS with your local IP address of the sand table
switch:
- platform: rest
resource: http://<SANDBOT_IP_ADDRESS>/setled
state_resource: http://<SANDBOT_IP_ADDRESS>/status
scan_interval: 5
name: "Sand Table"
body_on: '{"ledOn":1,"ledValue":100}'
body_off: '{"ledOn":0,"ledValue":100}'
is_on_template: "{{ value_json.ledOn == 1 }}"
headers:
Content-Type: application/json
-
This topic was modified 2 years, 6 months ago by Matt G.