polpas
(Polpas)
April 9, 2024, 9:22am
1
Hi all,
I have a sensor declared over configuration.yaml:
- name: AC200MAX ac output status
unique_id: "ac200max_ac_output"
state_topic: "bluetti/AC200M2142000119216/state/ac_output_on"
The state of the sensor is received as 1 or 0. How can I “cast” or change the received value to TRUE or FALSE or UNAVAILABLE at the configuration.yaml?
francisp
(Francis)
April 9, 2024, 9:43am
2
True/false : Make it a binary sensor instead of a sensor.
unavailable: add an availability template
polpas
(Polpas)
April 9, 2024, 10:02am
3
Hi there,
When I config as binary with the following confinguration:
binary_sensor:
name: AC200MAX ac output status
unique_id: "ac200max_ac_output"
state_topic: "bluetti/AC200M2142000119216/state/ac_output_on"
Even getting state messages of 1 and 0 the binary_sensor gets unavailable
francisp
(Francis)
April 9, 2024, 10:43am
4
binary_sensor:
- name: AC200MAX ac output status
unique_id: "ac200max_ac_output"
state_topic: "bluetti/AC200M2142000119216/state/ac_output_on"
payload_on: 1
payload_off: 0
polpas
(Polpas)
April 9, 2024, 10:54am
5
Thank you!!! it worked like a charm