Actually, plan was some different automation, dim lights on Kodi playing and raise back on Kodi paused/idle, but since this not worked, I’m trying to make basic simple case and understand how things are going with events. Unfortunately, below is not working as well. Want to get HA android app notification when light bulb is turned on and another HA android app notification when light bulb is turned off. Below is my setup.
When I toggle on/off this particular bulb, nothing happens, notifications are not arriving. I would mention also that same notifications are working for me, I’m using it when game is started on Playstation, but here I’m using state which is bit more simple for me. I never before used event.
I would also mention that bulb was toggled on/off from HA.
Unfortunately, there is nothing related in logs, either in Frontend Logbook or in /home-assistant.log , so I assume that my syntax isn’t good.
- id: '1584706054922'
alias: test bulb on
trigger:
platform: state
entity_id: light.bulb
from: 'off'
to: 'on'
action:
service: notify.mobile_app_sagit
message: sijalica je upaljena
- id: '1584706254500'
alias: test bulb off
trigger:
platform: state
entity_id: light.bulb
from: 'on'
to: 'off'
action:
service: notify.mobile_app_sagit
message: sijalica je ugasena
Or using just one automation:
alias: test bulb on or off
trigger:
platform: state
entity_id: light.bulb
action:
service: notify.mobile_app_sagit
data_template:
message: >
{% if trigger.to_state == 'on' %}
sijalica je upaljena
{% elif trigger.to_state == 'off' %}
sijalica je ugasena
{% else %}
sijalica nije definirana
{% endif %}
Thanks a lot guys, it seems I didn’t understood “State” automation trigger process before at all.
I was meant that “From” and “To” fields are supposed for time and always left it blank. Then I was used “ADD CONDITION” button below and was adding Condition type: “State” again, with same entity as above and state mostly on or off (playing or paused, etc.). This way, some automation were gives me double, triple notifications and/or bulb continue to turning on, no matter if I turn it off. This is normal in this case and I was meant that HA is buggy
Now I understand that From is old_state and To is the new_state, thanks once again.
From my point of view, both answers above are “Solution”. I guess I can mark only one, so will not mark any , sorry.
Depends … Are you showing any symptoms… ?
Can you please stand in line with 2,000 other people in close proximity for 6 hours so we can take your temperature ?