wez / govee2mqtt

Govee2MQTT: Connect Govee lights and devices to Home Assistant
MIT License
497 stars 32 forks source link

H5151 with 5100 sensors incorrectly converting a Fahrenheit number as though it was Celsius into Fahrenheit resulting in readings like 166F #247

Open cgoudie opened 3 months ago

cgoudie commented 3 months ago

Govee Device SKU

H5100

Govee2MQTT Version

2024.07.13-82ddc6e9

Describe the issue

Just installed and configured the Govee to MQTT integration. The humidity is showing correctly, but the temperature is wildly off. The app is showing 75.0 °F but the integration is showing 166.71 °F

All three of the Govee sensors I have are showing this.

Startup Diagnostics

[2024-07-22T09:31:11 INFO govee::commands::serve] Starting service. version 2024.07.13-82ddc6e9 [2024-07-22T09:31:11 INFO govee::commands::serve] Querying platform API for device list [2024-07-22T09:31:12 INFO govee::commands::serve] Querying undocumented API for device + room list [2024-07-22T09:31:13 INFO govee::service::iot] Connected to IoT: CONNACK code 0: Connection Accepted. [2024-07-22T09:31:13 INFO govee::commands::serve] Starting LAN discovery [2024-07-22T09:31:13 INFO govee::commands::serve] Waiting 10 seconds for LAN API discovery [2024-07-22T09:31:13 INFO govee::service::iot] IoT (re)connected with status CONNACK code 0: Connection Accepted. [2024-07-22T09:31:23 INFO govee::commands::serve] Devices returned from Govee's APIs [2024-07-22T09:31:23 INFO govee::commands::serve] Main Floor Bathroom (37:2D:34:30:38:CE:08:86 H5100) [2024-07-22T09:31:23 INFO govee::commands::serve] Platform API: devices.types.thermometer. supports_rgb=false supports_brightness=false [2024-07-22T09:31:23 INFO govee::commands::serve] color_temp=None segment_rgb=None [2024-07-22T09:31:23 INFO govee::commands::serve] Undoc: room=None supports_iot=false ble_only=true [2024-07-22T09:31:23 INFO govee::commands::serve] [2024-07-22T09:31:23 INFO govee::commands::serve] Master Bathroom Sensor (2E:2C:35:38:30:CB:AF:F4 H5100) [2024-07-22T09:31:23 INFO govee::commands::serve] Platform API: devices.types.thermometer. supports_rgb=false supports_brightness=false [2024-07-22T09:31:23 INFO govee::commands::serve] color_temp=None segment_rgb=None [2024-07-22T09:31:23 INFO govee::commands::serve] Undoc: room=None supports_iot=false ble_only=true [2024-07-22T09:31:23 INFO govee::commands::serve] [2024-07-22T09:31:23 INFO govee::commands::serve] Cyan Bathroom Sensor (39:67:35:38:30:CB:D7:2A H5100) [2024-07-22T09:31:23 INFO govee::commands::serve] Platform API: devices.types.thermometer. supports_rgb=false supports_brightness=false [2024-07-22T09:31:23 INFO govee::commands::serve] color_temp=None segment_rgb=None [2024-07-22T09:31:23 INFO govee::commands::serve] Undoc: room=None supports_iot=false ble_only=true [2024-07-22T09:31:23 INFO govee::commands::serve] [2024-07-22T09:31:23 INFO govee::service::http] http server addr is 0.0.0.0:8056 [2024-07-22T09:31:43 INFO govee::service::state] requesting update via Platform API Main Floor Bathroom (37:2D:34:30:38:CE:08:86 H5100) None [2024-07-22T09:31:43 INFO govee::service::state] requesting update via Platform API Master Bathroom Sensor (2E:2C:35:38:30:CB:AF:F4 H5100) None [2024-07-22T09:31:43 INFO govee::service::state] requesting update via Platform API Cyan Bathroom Sensor (39:67:35:38:30:CB:D7:2A H5100) None [2024-07-22T09:31:44 INFO govee::service::hass] Wait 140ms for hass to settle on 14 entity configs [2024-07-22T09:31:44 INFO govee::service::hass] MQTT connected with status=CONNACK code 0: Connection Accepted. [2024-07-22T09:46:44 INFO govee::service::state] requesting update via Platform API Main Floor Bathroom (37:2D:34:30:38:CE:08:86 H5100) Some(DeviceState { on: false, light_on: None, online: Some(true), kelvin: 0, color: DeviceColor { r: 0, g: 0, b: 0 }, brightness: 0, scene: None, source: "PLATFORM API", updated: 2024-07-22T15:31:43.503675254Z }) [2024-07-22T09:46:44 INFO govee::service::state] requesting update via Platform API Master Bathroom Sensor (2E:2C:35:38:30:CB:AF:F4 H5100) Some(DeviceState { on: false, light_on: None, online: Some(true), kelvin: 0, color: DeviceColor { r: 0, g: 0, b: 0 }, brightness: 0, scene: None, source: "PLATFORM API", updated: 2024-07-22T15:31:43.777480087Z }) [2024-07-22T09:46:44 INFO govee::service::state] requesting update via Platform API Cyan Bathroom Sensor (39:67:35:38:30:CB:D7:2A H5100) Some(DeviceState { on: false, light_on: None, online: Some(true), kelvin: 0, color: DeviceColor { r: 0, g: 0, b: 0 }, brightness: 0, scene: None, source: "PLATFORM API", updated: 2024-07-22T15:31:44.048547869Z }) [2024-07-22T10:01:44 INFO govee::service::state] requesting update via Platform API Main Floor Bathroom (37:2D:34:30:38:CE:08:86 H5100) Some(DeviceState { on: false, light_on: None, online: Some(true), kelvin: 0, color: DeviceColor { r: 0, g: 0, b: 0 }, brightness: 0, scene: None, source: "PLATFORM API", updated: 2024-07-22T15:46:44.362326331Z }) [2024-07-22T10:01:45 INFO govee::service::state] requesting update via Platform API Master Bathroom Sensor (2E:2C:35:38:30:CB:AF:F4 H5100) Some(DeviceState { on: false, light_on: None, online: Some(true), kelvin: 0, color: DeviceColor { r: 0, g: 0, b: 0 }, brightness: 0, scene: None, source: "PLATFORM API", updated: 2024-07-22T15:46:44.643363410Z }) [2024-07-22T10:01:45 INFO govee::service::state] requesting update via Platform API Cyan Bathroom Sensor (39:67:35:38:30:CB:D7:2A H5100) Some(DeviceState { on: false, light_on: None, online: Some(true), kelvin: 0, color: DeviceColor { r: 0, g: 0, b: 0 }, brightness: 0, scene: None, source: "PLATFORM API", updated: 2024-07-22T15:46:44.953299935Z }) [2024-07-22T10:16:45 INFO govee::service::state] requesting update via Platform API Main Floor Bathroom (37:2D:34:30:38:CE:08:86 H5100) Some(DeviceState { on: false, light_on: None, online: Some(true), kelvin: 0, color: DeviceColor { r: 0, g: 0, b: 0 }, brightness: 0, scene: None, source: "PLATFORM API", updated: 2024-07-22T16:01:45.276172085Z }) [2024-07-22T10:16:46 INFO govee::service::state] requesting update via Platform API Master Bathroom Sensor (2E:2C:35:38:30:CB:AF:F4 H5100) Some(DeviceState { on: false, light_on: None, online: Some(true), kelvin: 0, color: DeviceColor { r: 0, g: 0, b: 0 }, brightness: 0, scene: None, source: "PLATFORM API", updated: 2024-07-22T16:01:45.574550623Z }) [2024-07-22T10:16:46 INFO govee::service::state] requesting update via Platform API Cyan Bathroom Sensor (39:67:35:38:30:CB:D7:2A H5100) Some(DeviceState { on: false, light_on: None, online: Some(true), kelvin: 0, color: DeviceColor { r: 0, g: 0, b: 0 }, brightness: 0, scene: None, source: "PLATFORM API", updated: 2024-07-22T16:01:45.846399338Z })

Additional Logs

[2024-07-22T10:31:14 INFO govee::service::state] Polling Main Floor Bathroom (37:2D:34:30:38:CE:08:86 H5100) to get latest state after control [2024-07-22T10:31:14 INFO govee::service::state] requesting update via Platform API Main Floor Bathroom (37:2D:34:30:38:CE:08:86 H5100) Some(DeviceState { on: false, light_on: None, online: Some(true), kelvin: 0, color: DeviceColor { r: 0, g: 0, b: 0 }, brightness: 0, scene: None, source: "PLATFORM API", updated: 2024-07-22T16:31:09.116528797Z })

Home Assistant Logs

No response

Anything else?

No response

d4rkchild commented 3 months ago

Hi there, slightly different issue here. I am not sure if this will be fixed in the next release (beginner here and I can't figure out how to update govee2mqtt manually - Current version: 2024.07.13-82ddc6e9). My issue is the 3 5100s that are going through a H5151 gateway are showing C temperature in Farenheit. Server room temperature is a H5179 and is fine. Screenshot 2024-07-23 202701 I am running HAOS in a VM on proxmox. If anyone knows how to fix or manually update to the latest version before it is officially rolled.

cgoudie commented 3 months ago

Heh, I'm pretty sure it's the same problem. @d4rkchild I think the code is expecting a reading in C not in F, and then converting a value already in F from C to F.

cgoudie commented 3 months ago

75c = ~167f, which lines up with the problem I'm describing

sjafferali commented 3 months ago

Have a PR to fix this: https://github.com/wez/govee2mqtt/pull/256

fffloopo commented 1 month ago

I have got the same issue.

there is a workaround with a template:

template:

d4rkchild commented 4 weeks ago

Hi fffloopo

Regarding the below, apologies I am still learning HA. Is there a step by step guide or something that can give me an idea of how to implement the below. I think i can add templates via the helper section in HA but just wanted to double check.

Thanks

I have got the same issue.

there is a workaround with a template:

template:

  • sensor:

    • name: Govee_TemperatureH5100 unique_id: "GoveeTemp" unit_of_measurement: "C" state: >- {{ ((float(states('sensor.bath_temperature'))-32) *5/9) }}
fffloopo commented 4 weeks ago

Hi fffloopo

Regarding the below, apologies I am still learning HA. Is there a step by step guide or something that can give me an idea of how to implement the below. I think i can add templates via the helper section in HA but just wanted to double check.

Thanks

I have got the same issue. there is a workaround with a template: template:

  • sensor:

    • name: Govee_TemperatureH5100 unique_id: "GoveeTemp" unit_of_measurement: "C" state: >- {{ ((float(states('sensor.bath_temperature'))-32) *5/9) }}

I just added this lines in my configuration.yaml. Simply replace the unique_id: "GoveeTemp" with the name of your sensor entity.

stromdriver commented 2 weeks ago

ok after multiple attempts finally have the bridge working and have the page with all my govee devices, including the 5100's coming thru the 'hub' but i can't find the temp sensors anywhere in HA to add cards with them? Screenshot 2024-10-29 at 09-36-55 Govee Controller