Hey everyone, I’m currently working on setting up some automation in my smart home and I’m running into a bit of a snag with my Sonoff presence sensor. I recently migrated from ioBroker to Home Assistant and have managed to get some automations working, but this one is giving me a bit of a headache.
The idea is pretty straightforward: when the presence sensor detects someone in the kitchen, it should turn on the lights and maybe even the coffee machine. That part works like a charm! The issue arises when I leave the room. The devices stay on, which is not ideal. I’ve double-checked the YAML configuration, and everything seems to be in order. Here’s a quick snippet of what I have:
trigger:
- platform: state
entity_id: binary_sensor.sonoff_prasenzmelder_kuche_occupancy
from: “off”
to: “on” - platform: state
entity_id: binary_sensor.sonoff_prasenzmelder_kuche_occupancy
from: “on”
to: “off”
action: - if:
condition: trigger.id == “Präsenzmelder Küche Anwesenheit”
then:
- service: switch.turn_on
entity_id: switch.coffee_machine - if:
condition: trigger.id == “Präsenzmelder Küche keine Anwesenheit”
then:
- service: switch.turn_off
entity_id: switch.coffee_machine
I’ve also noticed that the sensor still shows the room as occupied even after I’ve left. I’m wondering if there’s something I’m missing in the sensor’s settings or if there’s a delay in the automation that I haven’t accounted for. Has anyone else encountered this issue with Sonoff sensors? I’d love to hear if there’s a workaround or a different approach to make this automation work seamlessly.
On a positive note, I’m really enjoying the flexibility that Home Assistant offers compared to ioBroker. The community support is amazing, and I’m excited to keep exploring and improving my setup. Fingers crossed, I’ll get this sorted out soon! ![]()