mdok
(Morten)
March 5, 2021, 3:57pm
1
My automation which runs when my frezzer opens broke after upgrading til 2021.3.x.
It is supposed to run then the freezer is open repeating a message every 5 seconds.
I have tried to find the error - but can not. Hoping for some help?
I get the error: “sonos_talk: Error executing script. Error for call_service at pos 4:”
The automation seems to be working fine - the script not so much for some reason.
My Automation:
- alias: 'Automation 48 - Freezer'
mode: single
trigger:
platform: numeric_state
entity_id: sensor.fibaro_system_fgbs222_smart_implant_burglar
above: 1
below: 4
condition:
- condition: and
conditions:
- condition: state
entity_id: input_boolean.fryser
state: 'on'
- condition: time
after: "07:30:00"
before: "23:00:00"
action:
- alias: "Repeat freezer message"
repeat:
sequence:
- service: script.sonos_talk
data:
sonos_entity: media_player.garage
volume: 0.25
message: "The freezer is open."
delay1: '00:00:05'
until:
- condition: state
entity_id: sensor.fibaro_system_fgbs222_smart_implant_burglar
state: '0'
My script:
script:
sonos_talk:
sequence:
- service: sonos.snapshot
data_template:
entity_id: "{{ sonos_entity }}"
- service: sonos.unjoin
data_template:
entity_id: "{{ sonos_entity }}"
- service: media_player.volume_set
data_template:
entity_id: "{{ sonos_entity }}"
volume_level: "{{ volume }}"
- service: tts.google_say
data_template:
entity_id: "{{ sonos_entity }}"
message: "{{ message }}"
- delay: "{{ delay1 }}"
- service: sonos.restore
data_template:
entity_id: "{{ sonos_entity }}"
tom_l
March 5, 2021, 4:03pm
2
That refers to this action in your script (the action/service positions start counting at 0):
- delay: "{{ delay1 }}"
I don’t see anything wrong. As a test try hard coding the delay to 5 seconds.
mdok
(Morten)
March 5, 2021, 4:52pm
3
Thanks,
changed
- delay: "{{ delay1 }}"
to
- delay: "00:00:05"
Same error after reloading scripts.
Removes the linie
delay1: '00:00:05'
from the automation - same error (sonos_talk: Error executing script. Error for call_service at pos 4:)
tom_l
March 5, 2021, 4:56pm
4
Ok that’s not what I expected.
Tonight has been full of weird issues. Is it a full moon or something?
Create a new script and hard code all these variables:
script:
sonos_talk:
sequence:
- service: sonos.snapshot
data_template:
entity_id: "{{ sonos_entity }}"
- service: sonos.unjoin
data_template:
entity_id: "{{ sonos_entity }}"
- service: media_player.volume_set
data_template:
entity_id: "{{ sonos_entity }}"
volume_level: "{{ volume }}"
- service: tts.google_say
data_template:
entity_id: "{{ sonos_entity }}"
message: "{{ message }}"
- delay: "{{ delay1 }}"
- service: sonos.restore
data_template:
entity_id: "{{ sonos_entity }}"
See what happens.
mdok
(Morten)
March 5, 2021, 6:20pm
5
No luck - keeps getting more and more weird
Automation:
- alias: 'Automation 48 - Freezer'
mode: single
trigger:
platform: numeric_state
entity_id: sensor.fibaro_system_fgbs222_smart_implant_burglar
above: 1
below: 4
condition:
- condition: and
conditions:
- condition: state
entity_id: input_boolean.fryser
state: 'on'
- condition: time
after: "07:30:00"
before: "23:00:00"
action:
- alias: "Repeat freezer message"
repeat:
sequence:
- service: script.sonos_talk
# data:
# sonos_entity: media_player.garage
# volume: 0.25
# message: "The freezer is open."
# delay1: '00:00:05'
until:
- condition: state
entity_id: sensor.fibaro_system_fgbs222_smart_implant_burglar
state: '0'
Script:
script:
sonos_talk:
sequence:
- service: sonos.snapshot
data_template:
entity_id: "media_player.garage"
- service: sonos.unjoin
data_template:
entity_id: "media_player.garage"
- service: media_player.volume_set
data_template:
entity_id: "media_player.garage"
volume_level: "0.25"
- service: tts.google_say
data_template:
entity_id: "media_player.garage"
message: "The freezer is open."
- delay: "00:00:05"
- service: sonos.restore
data_template:
entity_id: "media_player.garage"
Did a reboot - to be sure.
Error messages:
No. 1
Logger: homeassistant.components.script.sonos_talk
Source: helpers/script.py:1156
Integration: Script ([documentation](https://www.home-assistant.io/integrations/script), [issues](https://github.com/home-assistant/home-assistant/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+script%22))
First occurred: 19.05.29 (1 occurrences)
Last logged: 19.05.29
sonos_talk: Error executing script. Error for call_service at pos 4:
No 2
Logger: homeassistant.components.automation.automation_48_freezer
Source: helpers/script.py:1156
Integration: Automatisering ([documentation](https://www.home-assistant.io/integrations/automation), [issues](https://github.com/home-assistant/home-assistant/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+automation%22))
First occurred: 19.05.29 (2 occurrences)
Last logged: 19.05.29
* Automation 48 - Freezer: Repeat fryser besked: Error executing script. Error for call_service at pos 1:
* Automation 48 - Freezer: Error executing script. Error for repeat at pos 1:
No. 3
Logger: homeassistant.components.automation.automation_48_freezer
Source: components/automation/__init__.py:416
Integration: Automatisering (documentation, issues)
First occurred: 19.05.29 (1 occurrences)
Last logged: 19.05.29
Error while executing automation automation.automation_48_freezer:
mdok
(Morten)
March 5, 2021, 7:21pm
6
tts was not working.
I had removed base_url from “http:” in configuration.yaml (some days ago) since it was deprecated. Had not seen it had to be added to “tts:” instead.
All is working.
@tom_l - thanks for you time and help on this “weird”-night