While rewriting mqtt based entities from old to new format I found after reloading entities that all of them with the availability option configured are unavailable. Obviously, if I comment out availability, those became available.
Found that it doesn’t matter I use old or new availability format.
Not sure if HA restart may turn them available. But from experience collected so far multiple reloading of mqtt entities doesn’t help.
Is it a known issue? By quick glance I didn’t find anything related open in Github.
I have Home Assistant Core 2022.6.7
Example of the code (note, those are snippets come from packages so lacks top-level attributes those are members of)
- name: "Hall Floor 0"
command_topic: "shellies/shelly1-hall0/relay/0/command"
state_topic: "shellies/shelly1-hall0/relay/0"
availability_topic: "shellies/shelly1-hall0/online"
payload_available: "true"
payload_not_available: "false"
qos: 1
retain: false
payload_on: "on"
payload_off: "off"
optimistic: false
or
- name: 'Kitchen Worktop Right'
schema: template
command_topic: 'shellies/light-kitchen-worktop-r/color/0/set'
state_topic: 'shellies/light-kitchen-worktop-r/color/0/status'
availability:
topic: 'shellies/light-kitchen-worktop-r/online'
payload_available: "true"
payload_not_available: "false"
retain: false
qos: 1
command_on_template: >
{'turn': 'on'
{%- if brightness is defined -%}
, 'gain': {{ brightness | float | multiply(0.3922) | round(0) }}
{%- endif -%}
{%- if color_temp is defined -%}
, 'red': {{ ( (color_temp | float ) - 153 ) | multiply(0.734870317) | round(0) }}
, 'green': {{ ( 500 - (color_temp | float ) ) | multiply(0.734870317) | round(0) }}
, 'blue': 0
{%- endif -%}
}
command_off_template: '{"turn":"off"}'
state_template: '{% if value_json.ison %}on{% else %}off{% endif %}'
brightness_template: '{{ value_json.gain | float | multiply(2.55) | round(0) }}'
color_temp_template: '{{ ( ( value_json.red | float | multiply(1.36078431373) ) + 153 ) | round(0) }}'