# Google Assistant sensor state not being mapped

**URL:** <https://community.openhab.org/t/google-assistant-sensor-state-not-being-mapped/143182>\
**Category:** Beginners\
**Tags:** googlehome1, googleassistant\
**Created:** [January 9, 2023, 9:18pm UTC](https://community.openhab.org/t/google-assistant-sensor-state-not-being-mapped/143182 "2023-01-09T21:18:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![thomas93](https://community.openhab.org/user_avatar/community.openhab.org/thomas93/32/75070_2.png) [@thomas93](https://community.openhab.org/u/thomas93)\
**Post date:** [January 9, 2023, 9:18pm UTC](https://community.openhab.org/t/google-assistant-sensor-state-not-being-mapped/143182/1 "2023-01-09T21:18:39Z")

</div>

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:

```auto
value: Sensor
config:
  name: Fjernvarme Vandalarm
  sensorName: WaterLeak
  states: unknown=0,no leak=4,leak=16
  roomHint: Bryggers

```

According to the GA [documentation](https://developers.home.google.com/cloud-to-cloud/traits/sensorstate?hl=en#water-leak) it should support the 3 states configured above. According to the [OpenHAB documentation](https://www.openhab.org/docs/ecosystem/google-assistant/#sensor) 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?

---

<div class="post-metadata">

**Author:** ![denominator](https://community.openhab.org/user_avatar/community.openhab.org/denominator/32/37349_2.png) [@denominator](https://community.openhab.org/u/denominator)\
**Post date:** [January 10, 2023, 3:39am UTC](https://community.openhab.org/t/google-assistant-sensor-state-not-being-mapped/143182/2 "2023-01-10T03:39:05Z")

</div>

I am not sure you can add states using the GUI

Check the states are supported by google [Cloud-to-cloud &nbsp;|&nbsp; Google Home Developers](https://developers.home.google.com/cloud-to-cloud/traits/sensorstate)

Maybe try and set an item up using a txt file

---

<div class="post-metadata">

**Author:** ![thomas93](https://community.openhab.org/user_avatar/community.openhab.org/thomas93/32/75070_2.png) [@thomas93](https://community.openhab.org/u/thomas93)\
**Post date:** [January 10, 2023, 6:51am UTC](https://community.openhab.org/t/google-assistant-sensor-state-not-being-mapped/143182/3 "2023-01-10T06:51:49Z")

</div>

Hi James

The GUI certainly makes it look as if you can (marked with yellow):

 ![image](https://community-openhab-org.s3.dualstack.eu-central-1.amazonaws.com/original/3X/a/7/a70f209dbef3352507d01962619d2d8b611f52d6.png)

Interestingly enough, if I use the states of a smoke detector, the Google app shows “not registered” instead of the numeric value, even though the sensor name is configured as “WaterLeak”.

 ![image](https://community-openhab-org.s3.dualstack.eu-central-1.amazonaws.com/original/3X/a/3/a35a1e0cfed48f2741b85356ef7eb735cd8d1f78.png)

I can live with this, but I will leave my post here for further comments from developers of the integration or for anyone else having the same issue.
