I have a variable that returns “none” and in the automation it expects a “float” value:
- variables:
initialrv: "{{ state_attr('media_player.rv','volume_level') }}"
...THEN LATER, I TRY TO USE IT
- data:
volume_level: 0.6
target:
entity_id:
- media_player.rv
action: media_player.volume_set
- data:
message: "{{ message }}"
action: notify.alexa_media_rv
- data:
volume_level: "{{initialrv}}". <----- FAILS
target:
entity_id:
- media_player.rv
action: media_player.volume_set
is there a way to just set the variable to a value like 0.3 if it fails to get set or is unavailable initially?