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

Not able to translate MQTT state topic values in correct HASS light state. Probably due to templating

$
0
0

@Marcel1 wrote:

Hi!

I can’t get HASS to properly detect if my dimmer lights are ON or OFF via MQTT.
I am pretty sure i am overlooking something really simple. I am new to MQTT, so excuse me for asking stupid questions :slight_smile:

I have just two MQTT topics:

  • /service/fhem/gw_keukenkoof/dim
  • /service/fhem/gw_keukenkoof/cmnd

Publishing any number between 1 and 100 to the /cmnd topic will switch ON my lights (value 1 being the darkest and 100 being the brightest). Publishing a 0 will switch OFF my lights.
The /dim topic just represents the actual status

I am able to set the right dim value via HASS, however I am not able to read it. Even detecting if the lights are ON or OFF is not working for me. So controlling the brightness outside (or on/off state) outside of HASS is not reflected in HASS.

Below is my yaml

light:
  - platform: mqtt
    name: "Keuken Koof Dimmer"
    state_topic: "/service/fhem/gw_keukenkoof/dim"
    state_value_template: "{{ 'OFF' if value == '0' else 'ON' }}"
    command_topic: "/service/fhem/gw_keukenkoof/cmnd"
    payload_off: "0"
    payload_on: "30"
    brightness_state_topic: "/service/fhem/gw_keukenkoof/dim"
    brightness_command_topic: "/service/fhem/gw_keukenkoof/cmnd"
    on_command_type: 'brightness'
    brightness_scale: 100

Any help in the right direction is appreciated.

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 95385

Trending Articles



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