I have a script that is supposed to set my Eddi water heater to one of two modes: Stopped or Normal. Because the Eddi API is unreliable, I want to retry a number of times; and I’m using a script to code this logic in one place for use by various automations.
However when I run the script (from the script editor or from the developer console), I get this error message:
Option {{ mode }} is not valid for entity select.myenergi_eddi_23301706_operating_mode, valid options are: Stopped, Normal.
The script is:
description: Change Eddi mode, with repeats as API is unreliable
fields:
mode:
selector:
text: null
name: mode
required: true
description: Stopped or Normal
sequence:
- repeat:
sequence:
- device_id: ffc71174946331c0d6ea28c07d6fb3cc
domain: select
entity_id: 91b92249e73a5088e645961ddc3d822d
type: select_option
option: "{{ mode }}"
- delay:
hours: 0
minutes: 1
seconds: 0
milliseconds: 0
while:
- condition: not
conditions:
- condition: state
entity_id: select.myenergi_eddi_23301706_operating_mode
state: "{{ mode }}"
I was expecting {{ mode }} to resolve to Stopped or Normal, depending on what I set it to, but instead it remains unresolved.
I’ve tried calling the field other things but it makes no difference.
My completed script is as follows, in case anyone finds it useful. The 30s delay is to reduce the risk of exiting the loop without getting a refresh from the Eddi itself (otherwise I seem to just pick up the local change to the state that I just made).