I have a problem with state-controlled automations, can you help me?

Hi, I have a problem with state-based automations like these two, can you help me?

- id: accesspoint_down
  alias: 'Unifi Access Point Down'
  trigger:
    platform: state
    entity_id: device_tracker.uap_ac_lr
    from: 'home'
    to: 'not_home'
  action:
    service: notify.ha_notifiche
    data:
      message: 'UNIFI Access Point AC LR'

- id: '1547156414133'
  alias: Notifica Apertura Finestra Camera
  trigger:
  - entity_id: binary_sensor.finestra_camera
    from: 'off'
    platform: state
    to: 'on'
  condition: []
  action:
  - data:
      message: Si è aperta la finestra della camera
    service: notify.ha_notifiche

And what is your problem? Do you get an error? Please format your code correctly, like this we can not see if you have indetation errors. Mark the code and press the button </>.

the problem is that I don’t receive the telegram notification when the event occurs.

Not sure about the notifications, neither call a service (can’t check at the moment)
But the second automation has no trigger platform
Yes it does, weird AE formatting strikes again !

It has the platform state.

Burning, sorry cross post and fat fingers :smiley:

Do other automations with telegram work? Do you get any errors in Developer Tools -> Logs?
If you put something else as an action, e.g. turning on a light, does the automation work?

Everyday I hate this AE a bit more :rofl:

Burning, I’ve learnt something today (thank you)
You pointed out that you can highlight already entered text and then ‘preformat’ it.
Hence the like :smiley:

1 Like

yes, other automations with telegrams work, only these two do not work, I have 4 more with lights switching on / off

Ok that’s good. I mean’t replacing the notification action in these two automations with turning on a light, to see wether the problem is the telegram notification or the automation in general.

Could you please also provide the code of one of the working telegram notification automations?

Do you see nothing in the log when the event happens?

these are the automation for the light, but I don’t receive any error

- id: '1525464308767'
  alias: Accensione Luce Letto
  trigger:
  - entity_id: light.luce_letto
    from: 'off'
    platform: state
    to: 'on'
  condition: []
  action:
  - data:
      message: La luce del letto si è accesa
    service: notify.ha_notifiche

And this automation works?

What I meant is changing this:

- id: '1547156414133'
  alias: Notifica Apertura Finestra Camera
  trigger:
  - entity_id: binary_sensor.finestra_camera
    from: 'off'
    platform: state
    to: 'on'
  condition: []
  action:
  - data:
      message: Si è aperta la finestra della camera
    service: notify.ha_notifiche

To this:

- id: '1547156414133'
  alias: Notifica Apertura Finestra Camera
  trigger:
  - entity_id: binary_sensor.finestra_camera
    from: 'off'
    platform: state
    to: 'on'
  condition: []
  action:
  - entity_id: light.luce_letto
    service: light.turn_on

And see if the light.luce_letto turns on when binary_sensor.finestra_camera changes from “off” to “on”. This way I can see if the automation works and it’s just the telegram notification that is not working or if the automation doesn’t work at all.

thanks I do tests, I didn’t understand well

  1. Go to Developer > Tools > States and confirm the two automations are turned on.
  2. Trigger the automations manually and confirm they send notifications.
2 Likes

Why do I always forget this easy method to check if the actions work :roll_eyes:

Because your name is Sissyfus ??? (not sure of the spelling)

nothing, it doesn’t work either manually or automatically

Can you please show one of these working automations?

Have you checked the States page and confirmed the two automations are on?