We are house training our dog. I’d like to use alexa to say “Leia pooped” and have that trigger a routine that causes home assistant to store the date time in a variable (sensor maybe?). I’d also like to use alexa to say “When did Leia poop” which would trigger another routine to query home assistant and reply “Leia pooped 2 hours ago” or something like that.
I know how to create the routine, the home assistant “alexa entity” and whatnot but where I’m struggling is how to save the date time value and then how to query it for output as TTS in a friendly format. Ideally, I’d like to have a sensor as well update the UI because we are going to be deploying a tablet near the door and people can just look at the table to find the card that says “Leia Pooped” “2 hours ago” – I think that will require a template with sensor.time to make sure the sensor updates but again… I’m just getting started learning all this.
Would anyone be able/willing to assist with setting this up?
and this
I have virtual light switch that can be dim
I have a Routine in alexa
when I say “Alexa: when do I start work”
that Routine turn on the virtual light to 30%
and then in HA i have
- id: "Alexa: Report"
alias: "Alexa: Report"
trigger:
- platform: state
entity_id: light.alexa_virtual
to: 'on'
action:
- service: alexa_media.update_last_called #this will force update the last Alexa attribute used by the sensor
- delay: 00:00:01 # you may need to increase this value if you dont get the response on the echo you asked the question
- service: notify.alexa_media
data_template:
target:
- '{{ states.sensor.last_alexa.state }}'
data:
type: announce
message: >-
{% if (state_attr("light.alexa_virtual","brightness") | int / 255 * 10 )| int == 1 %}
Looking at the Jug it's {{ states('sensor.kettle_temperature') }} Degrees ?????
{% elif (state_attr("light.alexa_virtual","brightness") | int / 255 * 10 ) | int == 2 %}
The garage door is {{ states.cover.garage_door.state }}
{% elif (state_attr("light.alexa_virtual","brightness") | int / 255 * 10 ) | int == 3 %}
{{state_attr("sensor.stephan_4x4x12","alexa_say")}} # < = =
{% else %}
Please Check {{ (state_attr("light.alexa_virtual","brightness") | int / 255 * 10 ) | int }}
{% endif %}
- delay: 00:00:01
- service: light.turn_off
entity_id: light.alexa_virtual
This is not my idea found it here somewhere so they have the credit not me i just
change to match my needs
as it 30% or 3
so now when I says
Alexa: when do I start work
she reply by saying “there are 8 sleeps. therefore you are starting on sunday.”