I’m trying to start an automation to switch on my espresso machine, when my alarm clock on my mobile phone is ringing. I use the official homeassistant app for android to get the next alarm, which works fine. The problem is, that although the sensor switches to “true” correctly, the automation won’t start. However, if I manually set the variable “fabians_mobile_alarmclock_triggered” to true in dev tools, the automation is triggered. Maybe the time, the sensor variable is set to “true” is to short (apprx. 1 second) to trigger the automation? I don’t see what else could be the difference between setting the variably automatically vs. manually.
If I am not mistaken, your problem is that your trigger is “true”/“false” which are a strings.
Your value_template appears to evaluate to True/False (no quotes first letter capitalized). which are boolean objects
Try:
trigger:
- platform: state
entity_id: sensor.fabians_mobile_alarmclock_triggered
from: False
to: True
thanks for your quick reply. Apparently the value_template needs strings as input (if I type it like you said I get the error “Message malformed: expected str for dictionary value @ data[‘to’]”) but I changed the first letter to upper case (‘True’ and ‘False’) and it seems to work. The boolean expression is obviously case sensitive. I’m still wondering why the automation is triggered when I set the object manually, though.
Fair enough, I don’t personally use bools in any of my automation. Either on/off or plain strings (e.g. ‘idle’,‘Netflix’,etc.) Glad I was at least able to inspire you to the right direction
I use my snooze button too much for this to work for me. Plus on days off, I still want my coffee started or even done by the time I make it to the kitchen.
What I did was combine Tasker on android with Hassio. When I connect my bluetooth in the morning, It cancels any upcoming alarms, tells me the current weather and forecast at home (if it’s a work day, also at work as it is an hour away and about 800ft higher in elevation), cancels sleep mode on my watch, and triggers an HA script(coffee maker on [mqtt switch], den lights on, and turns sleep mode off, which silences most notifications). it will also eventually turn on an automation to start my car 10,15,or 20 minutes before it is time to leave for work based on outside and car interior temperature with an integration we are currently trying to make here.
I assume “my bluetooth” means bluetooth headphones/watch or something like it, then if that is the trigger then the coffee won’t be done, unless the weather report takes about 10-15 minutes to read.
Headphones yes. It also starts my podcasts which is what even got me started on this path even before I got into the smart home scene.
It usually is done or near done based on my morning routine, I don’t just pop up and head for the cup