Refactor mqtt topics for shelly plugs

This commit is contained in:
Timo Makinen 2025-04-05 17:37:56 +00:00
parent 95c66d976f
commit d6cc79dcb3
3 changed files with 10 additions and 5 deletions

View file

@ -12,5 +12,10 @@ bridge_certfile {{ tls_certs }}/{{ inventory_hostname }}.crt
bridge_keyfile {{ tls_private }}/{{ inventory_hostname }}.key
{% for shelly in shellies %}
{% if shelly['name'] | regex_search("^shellyplug-s-") %}
topic power out 0 shellies/{{ shelly['name'] }}/relay/0/ home/{{ shelly['room'] }}/{{ shelly['device'] }}/
topic temperature out 0 shellies/{{ shelly['name'] }}/ home/{{ shelly['room'] }}/{{ shelly['device'] }}/
{% else %}
topic # out 0 shellies/{{ shelly['name'] }}/ home/{{ shelly['room'] }}/{{ shelly['device'] }}/
{% endif %}
{% endfor %}