Help! Configuring an HM-SEC-SC-2 for automation

Hello there,

i need to configure automation for my Homematic HM-SEC-SC-2. In the “states” section i found it as an binary sensor.

Entity                         state    Attributes

binary_sensor.state            off      battery: High 
                                        sabotage: No
                                        rssi: 0 
                                        id: MEQ1597137
                                        interface: hmrf
                                        friendly_name: Fensterkontakt Esszimmer 
                                        device_class: opening

i tried this in my automation.yaml:

- alias: Esszimmerfenster offen
  trigger:
    platform: state
    entity_id: binary_sensor.MEQ1597137
    from: "off"
    to: "on"
  action:
    service: notify.pushover
    data:
      message: "Das Esszimmer Fenster wurde geöffnet!"

but it didn’t work :frowning:
how can i get the information from the device for an automation?

thanks in advance
Stephan

What is the name of the entity?
binary_sensor.state or
binary_sensor.MEQ1597137

I think it is “binary_sensor.state” so you have to enter this name to the trigger. Or you shoult take a look at the name of your sensors. My homatic sensor was automagicaly named like this: binary_sensor.oeq3428197_state

But perhaps i am wrong.

By the way i have
resolvenames: json
in the ccu definition

That’s correct if names don’t get resolved. With resolving names it would be something like binary_sensor.resolvedname_state. Everything else would mean the entity ID has been modified (via entity registry).

Thanks, that’ correct. with “state” it works!

cheers
Stephan