Hello everyone. Could someone tell me if they see something wrong with this automation. I would think it’s ok but I can’t find the problem. The motion sensor is zigbee and is controlled by zigbee2mqtt. The sensor states are false and true. I tried with those states and with on off and in no case did it work.
- alias: "Enciende pasillo cuando entras al pasillo de noche"
id: "12365745523"
mode: parallel
trigger:
platform: state
entity_id:
- sensor.sensor_pasillo_occupancy
from: 'off'
to: 'on'
condition:
- condition: and
conditions:
- condition: state
entity_id: light.comedor
state: "off"
- condition: state
entity_id: light.pasillo
state: "off"
- condition: state
entity_id: sun.sun
state: "below_horizon"
action:
- service: light.turn_on
target:
entity_id: light.pasillo
- delay:
seconds: 10
- service: light.turn_off
target:
entity_id: light.pasillo
- alias: "Enciende pasillo cuando entras al pasillo de noche"
id: "12365745523"
mode: parallel
trigger:
platform: state
entity_id:
- binary_sensor.sensor_pasillo_occupancy
from: 'off'
to: 'on'
If you don’t want to change to a binary sensor for some reason just change your trigger to:
- alias: "Enciende pasillo cuando entras al pasillo de noche"
id: "12365745523"
mode: parallel
trigger:
platform: state
entity_id:
- sensor.sensor_pasillo_occupancy
from: 'false'
to: 'true'
Also FYI when choosing a forum category:
Configuration: anything about configuring home assistant integrations, automations or scripts. Configuration - Frontend: anything about configuring dashboards and cards.
Hello. Tried to create the binary entity and it says unknown. The sensor type entity detects between true and false when it happened but the automation is never triggered. I keep trying things but I don’t know where the problem is
By default, MQTT Binary Sensor expects to receive ON and OFF in order to report on/off (unlike a Template Binary Sensor which accepts a broader range of ‘truthy/falsey’ values by default)
In your example, either change the default values to true/false