Need to do a REST command to send the integer value (1 or 0) of a binary sensor in home assistant. But when I try to do it, I get an error because it sends “on” or “off” rather than 1 or 0.
rest_command:
water_heater_status:
url: http://192.168.1.145/rest/vars/set/2/61/{{ states.binary_sensor.water_heater_running.state }}
username: uname
password: !secret isy_password
How do I send a numeric value rather than the text value? I tried doing math on it (| float) but that always gives 0 rather than 1 or 0.