I have tried to make this sensor, but have not been able to make this work, so no code to show.
Also tried chatGPT and just gotten unworking code.
So, This is the case:
I want to make a pill reminder that is reminding the user to consume pills if it is not done after 05:00 today (or between midnight-0500 today if it is after midnight).
So a boolean sensor.
The sensor I have to get the attrribute data from is sensor.grocy_chores, and the one with ID 3.
state_class: measurement
chores:
- id: 1
name: Test Chore
description: This is a test
period_type: manually
period_config: null
period_days: 1
track_date_only: false
rollover: false
assignment_type: in-alphabetical-order
assignment_config: '3'
next_execution_assigned_to_user_id: 3
userfields: null
last_tracked_time: '2025-01-12T08:40:08'
next_estimated_execution_time: null
last_done_by:
id: 2
username: xxx
first_name: xxx
last_name: xxx
display_name: xxx
track_count: 0
next_execution_assigned_user:
id: 3
username: xxx
first_name: xxx
last_name: xxx
display_name: xxxxxx
- id: 3
name: Ta piller
description: Ta dagens piller
period_type: daily
period_config: null
period_days: 1
track_date_only: false
rollover: false
assignment_type: in-alphabetical-order
assignment_config: '3'
next_execution_assigned_to_user_id: 3
userfields: null
last_tracked_time: '2025-01-12T08:39:14'
next_estimated_execution_time: '2025-01-13T05:00:00'
last_done_by:
id: 2
username: xxx
first_name: xxx
last_name: xxx
display_name: xxx xxx
track_count: 0
next_execution_assigned_user:
id: 3
username: xxx
first_name: xxx
last_name: xxx
display_name: xxx xxx
count: 2
unit_of_measurement: Chore(s)
icon: mdi:broom
friendly_name: Grocy chores
How I see it, it should be possible with these two:
last_tracked_time: '2025-01-12T08:39:14'
next_estimated_execution_time: '2025-01-13T05:00:00'
Suggestions?
In Grocy the chore is set for 05:00 every day.
The point is to take into account that the user may sit up after midnight and take the pills before bed.
Anyone want to try templating this?