I’ve connected my OpenHAB instance to Google Assistant. For starting out adding my different items, I’ve started with my smoke detectors and water leak detectors. The item shows up in Google Assistant, but the state mapping is not working – it simply shows the numeric value.
The water leak sensor already reports numeric values, such as “16” meaning “Warning/Leak detected”, so I figured I could simply utilize this. On the “Number” item I’ve added the following Google Assistant configuration:
value: Sensor
config:
name: Fjernvarme Vandalarm
sensorName: WaterLeak
states: unknown=0,no leak=4,leak=16
roomHint: Bryggers
According to the GA documentation it should support the 3 states configured above. According to the OpenHAB documentation that is how I should map the states. I would have expected Google Home to show the sensor as “No leak” when the value of the item is 4 and “Leak” when the item value is 16. Instead the sensor in the Google Home app simply shows the numeric value instead of the state.
What am I missing here?