Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 105840

Toggle switch read/set with rest api

$
0
0

Hi there,

I have a switch (true/false) that I can read or set with rest API. I like to have a toggle that can set this switch on/off or being updated when the switch got changed (without using this toggle).

I am so confused if I should use switch or sensor or binary_sensor or a combination?

switch:
  - platform: rest
    name: water_zone1
    resource: https://192.168.0.200/api/zone_1

The JSON data returned is

value: true or
value: false

So I think i need to add some thing like: value_template: '{{ value_json.value.status }}'

But after that I’m clueless. The code check is accepted and I can restart HAS but there is no trace of an additional switch. I must be skipping a part but I don’t know what.

Any pointers would be very much appreciated!

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 105840

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>