Desculpem
Este código
##########################################
########## Sensor Porta Entrada ##########
##########################################
- platform: mqtt
state_topic: 'tele/bridge/RESULT'
value_template: '{{value_json.RfReceived.Data}}'
name: p_entrada
- platform: template
sensors:
porta_entrada:
friendly_name: "Porta Entrada"
value_template: >
{%- if is_state('sensor.p_entrada', '9BC9EE') -%}
Aberta
{%- elif is_state('sensor.p_entrada', '9BC9E7') -%}
Fechada
{%- elif is_state('sensor.p_entrada', '9BC9EB') -%}
Adulterado
{%- endif -%}
icon_template: >
{% if is_state('sensor.p_entrada', '9BC9EE') %}
mdi:door-open
{% elif is_state('sensor.p_entrada', '9BC9E7') %}
mdi:door-closed
{% elif is_state('sensor.p_entrada', '9BC9EB') %}
mdi:image-broken
{% else %}
mdi:door
{% endif %}
##########################################
########## Sensor Porta Garagem ##########
##########################################
- platform: mqtt
state_topic: 'tele/bridge/RESULT'
value_template: '{{value_json.RfReceived.Data}}'
name: p_garagem
- platform: template
sensors:
porta_garagem:
friendly_name: "Porta Garagem"
value_template: >
{%- if is_state('sensor.p_garagem', 'B0D5EE') -%}
Aberta
{%- elif is_state('sensor.p_garagem', 'B0D5E7') -%}
Fechada
{%- elif is_state('sensor.p_garagem', 'B0D5EB') -%}
Adulterado
{%- endif -%}
icon_template: >
{% if is_state('sensor.p_garagem', 'B0D5EE') %}
mdi:door-open
{% elif is_state('sensor.p_garagem', 'B0D5E7') %}
mdi:door-closed
{% elif is_state('sensor.p_garagem', 'B0D5EB') %}
mdi:image-broken
{% else %}
mdi:door
{% endif %}
##########################################
########## Sensor Porta Cozinha ##########
##########################################
- platform: mqtt
state_topic: 'tele/bridge/RESULT'
value_template: '{{value_json.RfReceived.Data}}'
name: p_cozinha
- platform: template
sensors:
porta_cozinha:
friendly_name: "Porta Cozinha"
value_template: >
{%- if is_state('sensor.p_cozinha', '3759EE') -%}
Aberta
{%- elif is_state('sensor.p_cozinha', '3759E7') -%}
Fechada
{%- elif is_state('sensor.p_cozinha', '3759EB') -%}
Adulterado
{%- endif -%}
icon_template: >
{% if is_state('sensor.p_cozinha', '3759EE') %}
mdi:door-open
{% elif is_state('sensor.p_cozinha', '3759E7') %}
mdi:door-closed
{% elif is_state('sensor.p_cozinha', '3759EB') %}
mdi:image-broken
{% else %}
mdi:door
{% endif %}
Quando faço contacto com o sensor da porta de entrada, fechado, todos os outros sensores apresentam mesmo código “9BC9EE”