Hi I have created a script that takes in a parameter and calls another command.
device_id: baa529bdac31ba1a8ed11781f2d98e2f
domain: number
entity_id: number.zigbeealarm_duration
type: set_value
value: "{{duration}}"
The variable is obviously a float as when I attempt to save this I get an error stating “Message malformed: expected float for dictionary value @ data[‘value’]”
I have attempted various solutions in the forum but non of them appear to work. The one that appears to be the most popular is to use “{{ duration | float }}” but I get the same error message.
I have tried to convert the rest of my script using normal actions but it doesnt appear to be setting the values on the device. When I run the new script it plays but does not change the volume, sound etc.
The alarm plays but ignores all of the settings such as duration, volume and melody. I think I must have missed something somewhere. Any help would be appreciated.
Your code is… a mess. Feels like you need to start reading the documentation, not just throw stuff at the wall to see what sticks.
Replace the first and last action with switch.turn_off / switch.turn_on actions.
You should not be using a device id with any of these actions. If using a device id, the action will be attempted on every entity belonging to that device.
On two of the actions you are attempting to use a number.set_value on a select entity. Only actions prefixed with select. can operate on a select entity. In one of them you aren’t even feeding in a number, but a string.
Something like this, but you need to replace the intended values for your selects with the exact text of the desired options (without brackets around them):