Alert component not sending alert message, only done message

Hi all,

I have a strange issue with the aleert component:

heres my config:

alert:
  garage_door_still_open:
    name: Garage is still_open
    entity_id: binary_sensor.garagepoort_sensor
    state: 'on'
    repeat: 1
    can_acknowledge: True
    skip_first: False
    notifiers:
      - telegram_1
      - telegram_2

Somehow the component does not send any messages when triggered. I can see in the log the component is triggered itself, but no message is sent. If i use the done message, it does send that. The documentation states:

ā€œdone_message (Optional): A message sent after an alert transitions from on to off. Is only sent if an alert notification was sent for transitioning from off to on.ā€

This really doesnt make sense, since this indicates that the initial message should be sent as wel. Already tried disabling the skip_first option.

Any ideas?

Can you please format your code so that it shows the intends properly - see the blue box at the very top.
Otherwise itā€™s impossible for anybody else to see if the spacing might be the issue.

Apart from that my alert is set up exactly the same way and the only other thing I can think of are your notifiers, but Iā€™m sure youā€™ve checked that they work already.

Ok formatted the code, but pretty sure thats okā€¦
Notifiers are working fineā€¦like i said: if I use the done_message option, it sends it as soon as the garage door closes again. So this means the alert condition was met in the first placeā€¦

Looked at it again and it seems like you were right: the formatting looks fine.

The only difference I have in my setup that working is that I use pushbullet and Iā€™m on V059.2 - not sure which version youā€™re on, though, but it would mean that the component is broken in another version which is hard to believe.

Sorry, got nothing else.

I donā€™t know which sensor you have so Iā€™m going to suggest the following, go to the developer tools ā†’ states, look for the binary sensor your testing with, in this case, binary_sensor.garagepoort_sensor, cause it to be open, (donā€™t know if this is a door), and see if it changes to ā€˜onā€™ if it doesnā€™t that will be your problem.

To clarify, the state that you are pulling may be the incorrect one for the automation, for example, I have a sensor that shows ā€˜offā€™ but it never changes, however, a different attribute for the same sensor does change accordingly, so rather than ā€˜onā€™ or ā€˜offā€™ it shows 22 for open and 23 for closed.

Pretty sure the state is ā€œonā€ and ā€œoffā€

Look at the logs:
image

  1. Garagepoort status (this is the actual sensor), turned on
  2. the 3rd event even triggers another automation which has a state change of the garage sensor from ā€œoffā€ to ā€œonā€ as trigger ā€”> This automation part also sends a notification, which works!
  3. Garage is still open turned on --> This is the actual alert component that is not sending a notification, although it is triggered!
  4. Garagepoort status is off again --> At this point I even get a done_message (if used in the alert component)

So this means:

  1. notofications are working fine
  2. Status change of sensor is from off to on
  3. the actual alert component is triggered!

No idea why the notifiaction is not sentā€¦

If I understand this correctly, by setting the skip_first option to false, it should send a notification immediatly, right? But even if i wait 1 minute, still no messageā€¦

Ok, found the problem in the logs:

2018-02-01 21:27:36 INFO (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: 
domain=telegram_bot, service=send_message, service_data=target=126500423, message=Garage is 
still_open, service_call_id=1964606608-8>
2018-02-01 21:27:36 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_executed[L]:   service_call_id=1964606608-7>
2018-02-01 21:27:37 ERROR (SyncWorker_14) [homeassistant.components.telegram_bot] Error sending 
message: Can't parse entities in message text: can't find end of the entity starting at byte offset 15. Args: 
(126500423, 'Garage is still_open'), kwargs: {'parse_mode': 'Markdown', 'disable_notification': False, 
'disable_web_page_preview': None, 'reply_to_message_id': None, 'reply_markup': None, 'timeout': None}

still not sure what is causing thisā€¦something in the component is not working like it shouldā€¦

Have you tried putting your name Garage is still_open in single or double quotes?

Yep, already tried double quotesā€¦no luck.

Could be ā€œbinary_sensor.garagepoort_statusā€ is the actual sensor?

Your comment made me aware there was an (unintentional) underscore in the nameā€¦this was in fact causing the issue :P. Lol, took me few days to figure this outā€¦

Problem solved!

1 Like

Glad you got it sorted out :+1: