The automation I’m trying to create would look like this:
Next alarm time is a state inside the alexa entity. I want to grab this time and use it as a condition for other automations. Like if the alexa alarm is set for 5a, do something at 5:15a. I do want to save the time in a separate variable, so I can still use that time even after the alarm is cancelled in the alexa entity.
So I think I need to:
Create a helper input_datetime
Copy the state of the alexa entity to this helper
Use this helper as the condition time for a second automation.
Does this sound right? Any example code for doing these steps?
Thanks!
The State of the next_alarm sensor appears to be a timestamp:
When you created the Input Datetime helper, did you configure it to store both time and date?
If you did, post the automation that contains the input_datetime.set_datetime action.
If there is no automation yet, did you try to test the action using Developer Tools → Actions? If you did, it doesn’t support templates (thereby causing the action to fail).
If you use the action’s timestamp option then you must supply it with a numeric timestamp value.
If you use the action’s datetime option then you must supply it with a datetime string value.
Your posted automation used the timestamp option but supplied it with a datetime string value (incorrect value). That’s why the error message complained it wasn’t getting what it required.