I have configured a Shelly Plus RGBW PM as a 4x white light dimmer in configuration.yaml. Everything works except that when I start HA the status shown is “Unknown” for some minutes or until I press at least once the on/off command on its card. I don’t think that the problem is related to the configuration but I’m in search of advices. Below the extract from the configuration.
mqtt:
light:
- name: "shellyplusrgbwpm-macaddress-0"
unique_id: "shellyplusrgbwpm_macaddress_0"
command_topic: "shellies/shellyplusrgbwpm-macaddress/rpc"
state_topic: "shellies/shellyplusrgbwpm-macaddress/status/light:0"
availability_topic: "shellies/shellyplusrgbwpm-macaddress/online"
command_on_template: >
{"id": 0,"src": "ha","method": "Light.Set","params":{"id": 0,"on": true
{%- if brightness is defined -%}
, "brightness": {{brightness | float | multiply(0.3922) | round(0)}}
{%- endif -%}
}}
command_off_template: '{"id": 0,"src": "ha","method": "Light.Set","params":{"id": 0,"on": false}}'
<<: &shelly_rgbwpm
payload_available: 'true'
payload_not_available: 'false'
schema: template
state_template: "{% if value_json.output %}on{% else %}off{% endif %}"
brightness_template: "{{ value_json.brightness | float | multiply(2.55) | round(0) }}"
qos: 2
- name: "shellyplusrgbwpm-macaddress-1"
unique_id: "shellyplusrgbwpm_macaddress_1"
command_topic: "shellies/shellyplusrgbwpm-macaddress/rpc"
state_topic: "shellies/shellyplusrgbwpm-macaddress/status/light:1"
availability_topic: "shellies/shellyplusrgbwpm-macaddress/online"
command_on_template: >
{"id": 0,"src": "ha","method": "Light.Set","params":{"id": 1,"on": true
{%- if brightness is defined -%}
, "brightness": {{brightness | float | multiply(0.3922) | round(0)}}
{%- endif -%}
}}
command_off_template: '{"id": 0,"src": "ha","method": "Light.Set","params":{"id": 1,"on": false}}'
<<: *shelly_rgbwpm
- name: "shellyplusrgbwpm-macaddress-2"
unique_id: "shellyplusrgbwpm_macaddress_2"
command_topic: "shellies/shellyplusrgbwpm-macaddress/rpc"
state_topic: "shellies/shellyplusrgbwpm-macaddress/status/light:2"
availability_topic: "shellies/shellyplusrgbwpm-macaddress/online"
command_on_template: >
{"id": 0,"src": "ha","method": "Light.Set","params":{"id": 2,"on": true
{%- if brightness is defined -%}
, "brightness": {{brightness | float | multiply(0.3922) | round(0)}}
{%- endif -%}
}}
command_off_template: '{"id": 0,"src": "ha","method": "Light.Set","params":{"id": 2,"on": false}}'
<<: *shelly_rgbwpm
- name: "shellyplusrgbwpm-macaddress-3"
unique_id: "shellyplusrgbwpm_macaddress_3"
command_topic: "shellies/shellyplusrgbwpm-macaddress/rpc"
state_topic: "shellies/shellyplusrgbwpm-macaddress/status/light:3"
availability_topic: "shellies/shellyplusrgbwpm-macaddress/online"
command_on_template: >
{"id": 0,"src": "ha","method": "Light.Set","params":{"id": 3,"on": true
{%- if brightness is defined -%}
, "brightness": {{brightness | float | multiply(0.3922) | round(0)}}
{%- endif -%}
}}
command_off_template: '{"id": 0,"src": "ha","method": "Light.Set","params":{"id": 3,"on": false}}'
<<: *shelly_rgbwpm