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

MQTT light with json state topic not working payload_on

$
0
0

@Dreamoffice wrote:

hi
actually i try to setup new MQTT light but i have some problems.
This setup as a switch is running:

switch:
  - platform: mqtt
    name: Licht Garage
    state_topic: "stat/garage/RESULT"
    value_template: "{{value_json.S29cmnd_D0.STATE }}"
    payload_on: "ON"
    payload_off: 'OFF'
    state_on: "ON"
    state_off: "OFF"
    command_topic: "cmnd/garage/Sensor29"
    payload_on: "0, ON"
    payload_off: "0, OFF"

but if i set it up as light the state is noch changing. when i switch on the light the button jumps back to off. how can i fix it?
this code is not running, how can i read the state?

light:
  - platform: mqtt
    name: Licht Garage
    state_topic: "stat/garage/RESULT"
    value_template: "{{value_json.S29cmnd_D0.STATE }}"
    payload_on: "ON"
    payload_off: 'OFF'
    # state_on: "ON"
    # state_off: "OFF"
    command_topic: "cmnd/garage/Sensor29"
    payload_on: "0, ON"
    payload_off: "0, OFF"

Posts: 5

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 95419

Trending Articles



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