I am very new here (First post) and still learning a lot.
My current stumbling block is that I have got my GW4 paired up with HA.
I am able to track its Activity State, one of them being “asleep”.
I would like to do some things when it detects me sleeping, but cannot figure out how to use it as a trigger.
I set up the following automation:
alias: When Jeb Falls Asleep
description: ""
trigger:
- platform: state
entity_id:
- sensor.jebs_watch_activity_state
attribute: exercise_type
to: asleep
condition:
- condition: time
after: "21:00:00"
before: "05:30:00"
weekday:
- mon
- tue
- wed
- thu
- fri
- sat
- sun
action:
- service: light.turn_off
data: {}
target:
entity_id: light.all_lights
mode: single
My watch indeed changed from the “passive” state to the “asleep” state within ±30min of me going to bed, but the automation was not triggered.
Trying to figure out where it’s gone wrong.
The automation still says it’s never been triggered, there are logs of the activity state changing to “asleep” and then a few hours back to “passive”.
I’m wondering if I’ve implemented the following attribute incorrectly:
When using the GUI to set up the automation, the only “trigger” I can find is a “state” change.
And the only options it gives me are “Exercise Type” and “Time”.
What would I use, if not the exercise_type, which after seeing the “Attributes” list, is definitely not the right one?
Ideally, I would need to track the “state” (middle column of the previous picture I shared), but not sure how to go about this.
You can look at the state history of the sensor by clicking on the sensor or by selecting it in the history panel. That should show it it is the sensor state value or the attribute state value that changed to sleeping.