Logger: homeassistant.helpers.script
Source: helpers/script.py:638
First occurred: 1:45:11 PM (58812 occurrences)
Last logged: 2:47:52 PM
Error in ‘condition’ evaluation: In ‘template’ condition: TypeError: argument of type ‘NoneType’ is not iterable
Error in ‘condition’ evaluation: In ‘template’ condition: UndefinedError: list object has no element 156
I had a new variation of the error start at 8:30 pm last night in addition to the original post when my medication reminder kicked in.
Original post (now):
Logger: homeassistant.helpers.script
Source: helpers/script.py:638
First occurred: February 5, 2022, 7:33:04 PM (888576 occurrences)
Last logged: 11:22:33 AM
Error in 'condition' evaluation: In 'template' condition: TypeError: argument of type 'NoneType' is not iterable
Error in 'condition' evaluation: In 'template' condition: UndefinedError: list object has no element 156
New one:
Logger: homeassistant.helpers.script
Source: helpers/script.py:659
First occurred: February 5, 2022, 8:30:04 PM (57 occurrences)
Last logged: 10:30:04 AM
Error in 'choose[0]' evaluation: In 'template' condition: UndefinedError: 'None' has no attribute 'event'
alias: Medication Remindar - Evening
description: ''
use_blueprint:
path: Aohzan/medication_reminder.yaml
input:
logbook_message_no_answer: No answer (timed out)
notify_device: 52fa40cb8ef749a1a7800d6495551219
input_boolean: input_boolean.medication_taken
reminder_time: '20:00:00'
logbook_message_skip: Reminder skipped
optional_action:
- service: notify.alexa_media_last_called
data:
message: It's time to take your pills!
data:
type: tts
logbook_message_later: Reminder postponed
logbook_message_taken: Medication taken
logbook_message_remind: Reminder sent
notification_action_skip: Skip
notification_action_later: Ask later
notification_action_taken: Taken
notification_message: It's time to take your medication
notification_title: Medication reminder!
blueprint:
name: Advanced medication reminder
description: Get advanced notification and history for medication reminder
domain: automation
input:
reminder_time:
name: Reminder time
description: At what time do you want to be reminded
selector:
time: {}
notify_device:
name: Notification
description: Device needs to run the official Home Assistant app to receive
notifications
selector:
device:
integration: mobile_app
input_boolean:
name: Dedicated input_boolean
description: Create and set here a input_boolean to handle history and state
of the automation
selector:
entity:
domain: input_boolean
notification_title:
name: Notification title (Optional)
description: 'Default: Medication reminder'
default: Medication reminder!
notification_message:
name: Notification message (Optional)
description: 'Default: It''s time to take your medication'
default: It's time to take your medication
notification_action_taken:
name: 'Notification action: Taken (Optional)'
description: 'Default: Taken'
default: Taken
notification_action_later:
name: 'Notification action: Ask later (Optional)'
description: 'Default: Ask later'
default: Ask later
notification_action_skip:
name: 'Notification action: Skip (Optional)'
description: 'Default: Skip'
default: Skip
ask_later_wait_time:
name: Wait time before next reminder
description: Minutes before notify again after a Ask later action.
default: 30
selector:
number:
min: 5.0
max: 1440.0
unit_of_measurement: minutes
step: 1.0
mode: slider
logbook_message_remind:
name: Logbook message for remind (Optional)
description: 'Default: Reminder sent'
default: Reminder sent
logbook_message_taken:
name: Logbook message for action Taken (Optional)
description: 'Default: Medication taken'
default: Medication taken
logbook_message_later:
name: Logbook message for action Ask later (Optional)
description: 'Default: Postpone reminder'
default: Postpone reminder
logbook_message_skip:
name: Logbook message for action Skip (Optional)
description: 'Default: Reminder skipped'
default: Reminder skipped
logbook_message_no_answer:
name: Logbook message for no action after timeout (Optional)
description: 'Default: No answer time out'
default: No answer time out
optional_action:
name: Optional action
description: Run an action like notify a speaker at the same time that the mobile
notification
selector:
action: {}
default: []
source_url: https://raw.githubusercontent.com/Aohzan/hass-blueprints/main/blueprints/medication_reminder.yaml
trigger:
- platform: time
at: !input 'reminder_time'
mode: restart
action:
- service: input_boolean.turn_off
target:
entity_id: !input 'input_boolean'
- alias: Notify until the medication has been take
repeat:
while:
- condition: state
entity_id: !input 'input_boolean'
state: 'off'
sequence:
- service: logbook.log
data:
name: !input 'notification_title'
message: !input 'logbook_message_remind'
entity_id: !input 'input_boolean'
Have you shortened the blueprint because I don’t see the repeat and choose action. If it is only a copy accident I would agree that it could be caused by the 2022.2.2 version.
I’ve re-enabled all other automations and the errors have stopped.
That is the only automation triggering it. Now, why is that event firing every 10 seconds…
I’ve left the original pre-blueprint automation disabled and downloaded the new blueprint from Garbage-Collection, configured the automation from it and HA is happy with it - no errors.
Original automation:
They look the same to me. So I re-enabled the original automation and now no errors except for 156 when HA starts. WTH? Why before was there the repetition every 10 seconds but not now?
Now to figure out why there’s 156 at startup…no biggie though. Thanks for helping me work through this!
Actually, automation is not triggered at that rate, core is trying to evaluate the template and failing to do, maybe, automation would not do anything but template should be resolved to decide.
I could not figure out the source for the multiple triggers other than they were 156 every 10 seconds and could not figure out a rhyme or reason. The errors are gone now after the above changes so I will let sleeping dogs lie…