Govee Temp sensors with ESP32

Hi…new here.

I installed Venus os on a Rpi4 with a touch display – that’s working great. Shunts, solar controllers, inverter…etc all working. Next step is to integrate Govee Temp sensors via ESP32 as a gateway. I found enough examples to get me as far as failure. I have dbus-mqtt-devices installed on Venus. My problem is that the EPS32 never connects to Venus (venus is on the same network: FBISurveillanceVan). This is the yaml file, that ChatGpt generated. Can anyone give me a clue how to get this working or how to debug it. ChatGpt also suggested additions to the services.yaml, but I’m not sure if that’s required?

I’ve read just about everything @freakent published, but there are just a few things I don’t understand in order to connect all the dots…

Any advice is welcome…thanks

Ron.

services yml

services:

  • name: LivingRoom
    id: govee_livingroom
    type: temperature
    mqtt:
    temperature: govee/LivingRoom/temperature
    humidity: govee/LivingRoom/humidity
    battery: govee/LivingRoom/battery

  • name: Fridge
    id: govee_fridge
    type: temperature
    mqtt:
    temperature: govee/Fridge/temperature
    humidity: govee/Fridge/humidity
    battery: govee/Fridge/battery

  • name: Freezer
    id: govee_freezer
    type: temperature
    mqtt:
    temperature: govee/Freezer/temperature
    humidity: govee/Freezer/humidity
    battery: govee/Freezer/battery

govee-to-venus.yaml

esphome:
name: govee-to-venus
friendly_name: Govee to Venus

esp32:
board: esp32dev
framework:
type: esp-idf

logger:
level: DEBUG

ota:

wifi:
ssid: “FBISurveillanceVan”
password: “DEAD1DEAD1”

manual_ip:
static_ip: 192.168.1.253
gateway: 192.168.1.1
subnet: 255.255.255.0

mdns:
disabled: false

mqtt:
broker: 192.168.1.110
discovery: false
topic_prefix: govee

esp32_ble_tracker:
scan_parameters:
active: false
interval: 1100ms
window: 1100ms

-----------------------------

LAMBDA DECODER (WORKS ON ALL ESPHOME VERSIONS)

-----------------------------

Govee H5179 / H5111 / H5075 style packets:

Byte2-4 = temp/humidity encoded

Byte5 = battery

-----------------------------

LIVING ROOM

on_ble_manufacturer_data:

  • mac_address: “AA:BB:CC:DD:EE:01”
    then:
    • lambda: |-
      if (x.size() < 6) return;

      int raw = (int(x[2]) << 16) | (int(x[3]) << 8) | int(x[4]);
      bool neg = raw & 0x800000;
      if (neg) raw ^= 0x800000;

      float temp = raw / 10000.0f;
      float hum = (raw % 1000) / 10.0f;
      float batt = x[5];
      if (neg) temp = -temp;

      id(livingroom_temperature).publish_state(temp);
      id(livingroom_humidity).publish_state(hum);
      id(livingroom_battery).publish_state(batt);

FRIDGE

  • mac_address: “AA:BB:CC:DD:EE:02”
    then:
    • lambda: |-
      if (x.size() < 6) return;

      int raw = (int(x[2]) << 16) | (int(x[3]) << 8) | int(x[4]);
      bool neg = raw & 0x800000;
      if (neg) raw ^= 0x800000;

      float temp = raw / 10000.0f;
      float hum = (raw % 1000) / 10.0f;
      float batt = x[5];
      if (neg) temp = -temp;

      id(fridge_temperature).publish_state(temp);
      id(fridge_humidity).publish_state(hum);
      id(fridge_battery).publish_state(batt);

FREEZER

  • mac_address: “AA:BB:CC:DD:EE:03”
    then:
    • lambda: |-
      if (x.size() < 6) return;

      int raw = (int(x[2]) << 16) | (int(x[3]) << 8) | int(x[4]);
      bool neg = raw & 0x800000;
      if (neg) raw ^= 0x800000;

      float temp = raw / 10000.0f;
      float hum = (raw % 1000) / 10.0f;
      float batt = x[5];
      if (neg) temp = -temp;

      id(freezer_temperature).publish_state(temp);
      id(freezer_humidity).publish_state(hum);
      id(freezer_battery).publish_state(batt);

-----------------------------

SENSORS (MQTT AUTO-PUBLISH)

-----------------------------

sensor:

  • platform: template
    id: livingroom_temperature
    name: “LivingRoom Temperature”
    unit_of_measurement: “°C”
    accuracy_decimals: 2

  • platform: template
    id: livingroom_humidity
    name: “LivingRoom Humidity”
    unit_of_measurement: “%”
    accuracy_decimals: 1

  • platform: template
    id: livingroom_battery
    name: “LivingRoom Battery”
    unit_of_measurement: “%”
    accuracy_decimals: 0

  • platform: template
    id: fridge_temperature
    name: “Fridge Temperature”
    unit_of_measurement: “°C”
    accuracy_decimals: 2

  • platform: template
    id: fridge_humidity
    name: “Fridge Humidity”
    unit_of_measurement: “%”
    accuracy_decimals: 1

  • platform: template
    id: fridge_battery
    name: “Fridge Battery”
    unit_of_measurement: “%”
    accuracy_decimals: 0

  • platform: template
    id: freezer_temperature
    name: “Freezer Temperature”
    unit_of_measurement: “°C”
    accuracy_decimals: 2

  • platform: template
    id: freezer_humidity
    name: “Freezer Humidity”
    unit_of_measurement: “%”
    accuracy_decimals: 1

  • platform: template
    id: freezer_battery
    name: “Freezer Battery”
    unit_of_measurement: “%”
    accuracy_decimals: 0

why don´t you use NodeRED? Import the sensors through MQTT?

I also have / had many special scripts - but with the growing features of NodeRED on Venus, i move more and more to plain MQTT

It sounds like ChatGPT has mixed you a cocktail of technologies and over complicated things.

Is the services.yml file you posted suppposed to be for dbus-mqtt-devices? If so I’m surprised it even runs.

it looks like you are trying to use ESPHome on your microcontrollers to talk to Victron.

If you want help with dbus-MQTT-devices can O ask you start a discussion of the GitHub discussion page for the project

Regards

Martin

If you aren’t sure how to do it, do not rely on AI then come here and ask the community to fix the hallucination.
Rather just ask for help.

Will do…thanks for the tip

I know diddly about NodeRED at the moment. I’ll start reading. One question, will it require more hardware than the venus the rpi and maybe a ESP32?

ron

no, you just have to install Benus OS Large, then you get NodeRED

The ESP32 you need as bridge to Govee Sensors

At first, install something like MQTT Explorer on your PC and check for MQTT Messages from the Bridge

You could use the MQTT Broker in Venus, but you have to send a keep-alive signal - could also be done by NodeRED

I wrote a program that will run directly on Cenus OS to bring Govee sensors in just like Ruuvi sensors.

I’m wrong in on cleaning it up for public release.

What Govee sensors are you using?

Very nice…I’m using HS5179 and H5111 for temp/humidity and the H5059 water sensors.

If you don’t mind sharing the code, even if it’s not clean…I’m interested in learning as much as I can at this point.

Ron

By cleaned up I mean removing my personal system specific stuff from it. I’m away from my system this week, but I’ll try to get something posted up when I get back.