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

MQTT Switch - value_template

$
0
0

@rak wrote:

Hi,

digging into MQTT and a switch.

switch:
  - platform: mqtt
    name: "Venus GX Relay 0"
    state_topic: "N/xxx/system/0/Relay/0/State"
    value_template: "{{ value_json.value == 1 }}"
    command_topic: "W/xxx/system/0/Relay/0/State"
    payload_on: '{"value": 1}'
    payload_off: '{"value": 0}'

The MQTT state is a json object. See Payload on/off.

I cant get the state extracted with the value template. Any help appreatiated.

Regards
Ralf

Posts: 9

Participants: 3

Read full topic


Viewing all articles
Browse latest Browse all 95919

Trending Articles



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