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

Shelly 1 and Shelly dimmer: works via Node-RED, not via yaml

$
0
0

@HarmLammers wrote:

I’m new to Home Assistant: I just installed it and try to add two Shellies (a Shelly 1 and a Shelly Dimmer) via MQTT. I installed Mosquitto and via Node-RED I can see messages coming in and I can turn on and off the light, so MQTT is working. I also added them to configuration.yaml, and they do appear, but the status isn’t shown (always off) and if I try to turn the Shelly 1 on (in developer/status) nothing happens and the gui button switches back to off.

This is my definition in configuration.yaml:

light:
  - platform: mqtt
    name: "Living room stairs"
#    availability_topic: "shellies/shelly1-98F4ABF32644/online"
    state_topic: "shellies/shelly1-98F4ABF32644/relay/0"
    command_topic: "shellies/shelly1-98F4ABF32644/relay/0/command"
    payload_on: "on"
    payload_off: "off"
    payload_available: "true"
    payload_not_available: "false"
    retain: true
  - platform: mqtt
    schema: template
    name: "Living room dimmer"
#    availability_topic: "shellies/shellydimmer-DB3216/online"
    state_topic: "shellies/shellydimmer-DB3216/light/0/status"
    command_topic: "shellies/shellydimmer-DB3216/light/0/set"
    state_template: "{% if value_json.ison %}on{% else %}off{% endif %}"
    command_off_template: '{"turn":"off"}'
    command_on_template: >
        {"turn": "on"
        {%- if brightness is defined -%}, "brightness": {{brightness | float | multiply(0.3882 + 1) | round(0)}}{%- endif -%}}
    brightness_template: "{{ value_json.brightness | float | multiply(2.55) | round(0) }}"
    retain: true

if I send “on” and “off” to shellies/shelly1-98F4ABF32644/relay/0/command via Node-RED it does work.

What could be the issue?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 95409

Trending Articles



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