Govee Appliances (Heaters, Fans, Purifiers)

Hi, trying to get mine going, did you get modes working? On and Off works, but when trying to toggle mode, i just get:
ERROR (MainThread) [homeassistant.helpers.script.govee_smart_heater] Govee Smart Heater: Error executing script. Service not found for call_service at pos 1: Unable to find service script.govee_smart_heater_mode

My Configuration.yaml:

rest_command:
  rest_govee_appliance:
    url: https://developer-api.govee.com/v1/appliance/devices/control
    method: PUT
    headers:
      Content-Type: application/json
      Govee-API-Key: !secret govee_api_key
    content_type: "application/json; charset=utf-8"
    payload: '{"device": "{{ device }}","model": "{{ model }}","cmd": {"name": "{{ cmd_name }}","value": "{{ cmd_value }}"}}'

fan:
  platform: template
  fans:
    govee_smart_heater:
      friendly_name: "Govee Smart Heater"
      value_template: "{{ states('input_boolean.govee_smart_heater_status') }}"
      preset_mode_template: "{{ states('input_select.govee_smart_heater_mode') }}"
      turn_on:
        service: script.govee_smart_heater_on
      turn_off:
        service: script.govee_smart_heater_off
      set_preset_mode:
        service: script.govee_smart_heater_mode
        data:
          govee_smart_heater_mode: >
            {% set mapper = {'Low': 1, 'Medium': 2, 'High': 3, 'Fan': 4, 'Auto': 5} %}
            {{ mapper[preset_mode] }}
      speed_count: 3
      preset_modes:
        - "Low"
        - "Medium"
        - "High"
        - "Fan"
        - "Auto"

and my scripts:

script:
  smart_heater_on:
    alias: Govee Smart Heater On
    sequence:
      - service: rest_command.rest_govee_appliance
        data:
          device: 19:79:00:00:00:00:00:00
          model: H713A
          cmd_name: turn
          cmd_value: "on"
        enabled: true
      - delay:
          hours: 0
          minutes: 0
          seconds: 0
          milliseconds: 300
      - service: input_boolean.turn_on
        target:
          entity_id: input_boolean.govee_smart_heater_status
        data: {}
    mode: single
  smart_heater_off:
    alias: Govee Smart Heater Off
    sequence:
      - service: rest_command.rest_govee_appliance
        data:
          device: 19:79:00:00:00:00:00:00
          model: H713A
          cmd_name: turn
          cmd_value: "off"
        enabled: true
      - delay:
          hours: 0
          minutes: 0
          seconds: 0
          milliseconds: 500
      - service: input_boolean.turn_off
        target:
          entity_id: input_boolean.govee_smart_heater_status
        data: {}
      - service: input_select.select_option
        entity_id: input_select.govee_smart_heater_mode
        data:
          option: "Off"
    mode: single
  smart_heater_mode:
    alias: Govee Smart Heater Mode
    sequence:
      - service: input_select.select_option
        entity_id: input_select.govee_smart_heater_mode
        data:
          option:
            '{% set mapper = {"Low": 1, "Medium": 2, "High": 3, "Fan": 4, "Auto": 5} %} {{mapper[govee_smart_heater_mode]
            }}'
        enabled: true
      - delay:
          hours: 0
          minutes: 0
          seconds: 0
          milliseconds: 500
      - service: rest_command.rest_govee_appliance
        data:
          device: 19:79:00:00:00:00:00:00
          model: H713A
          cmd_name: mode
          cmd_value: "{{ govee_smart_heater_mode }}"
      - service: input_boolean.turn_on
        target:
          entity_id: input_boolean.govee_smart_heater_status
        data: {}
    mode: single
    icon: mdi:radiator

My Helper:

I must have made an obvious mistake, but im struggling to see it

1 Like

your device id looks too short

I was using the mac address, where do I find the device ID?

Cheers in advance.

You can use CURL from a linux box

curl --request GET \
  --url https://developer-api.govee.com/v1/appliance/devices/ \
  --header 'Content-Type: application/json' \
  --header 'Govee-API-Key: 00000000-729c-4b82-b536-000000000'

Obviously use your api key :wink:

1 Like

Just Brilliant, Thank you.

1 Like

Hey @tradel, do you mind giving a little bit more detail on how you did this. I got the device added to homekit via homebridge, but when I try to add the device in HA I just get the error ā€œno unpaired devices could be foundā€.

If HA canā€™t see HomeBridge, it could be a problem with mDNS on your network. Check the HomeBridge logs.

Hello Jimmy,
sadly my modes are not working yet. Due to other projects I put it on hold for the future :slight_smile:

1 Like

Any indication of a URI to monitor for API feedback or status updates?

The only way to monitor for feedback and status at the moment is set up homebridge with the govee plugin.

Someone should be able to port the govee plugin to home assistant which would give us the option natively. But no one has attempted it yet.

Hi Jimmy,

It looks like you are calling script.govee_smart_heater_mode, but your script name is smart_heater_mode. see the screenshot below:

You need to either change your script name to govee_smart_heater_mode or remove govee_ to read script.smart_heater_mode for the scripts you are calling within the fan template.

Make sure to update all of your script names or your fan template script names.

Hopefully this helps.

1 Like

I am running homebridge just for govee right now.

I initially had the HB connected to HA but HA didnā€™t know what to do with my govee air purifier. It showed up as a device but with no entities.

So for the moment I have HB connected directly to HK and in HA Iā€™m running the govee LAN hacs integration.

All of this is ok except for that HA canā€™t control any of my govee appliances.

Anyway tomorrow govee is supposedly launching the Govee Development Platform, which sounds like will have a more in-depth API. Fingers crossed a solid homeassistant integration comes out of it. Hopefully!

Thanks for this - Amazing guide!

How would I change the configuration.yaml file if I have 2 heaters? (govee_heater_living_room and govee_heater_bedroom)
-I made separate scripts for them, which all work, but I am unable to get the two fan. entities to work.

thanks!
Alex

1 Like

Thank you @sdaltons for pointing this out. There is a new API now available with control AND status for appliance devices. Looks like they are merging the lighting in as well.

I already have the device list call, control call, and status update request!
I say we start talking about an actual integrationā€¦ whoā€™s in?

Iā€™m in! But I will have to leave it to those of you who are much better than me at this stuff.

Happy to help with any testing though!

Iā€™m in, already started slapping some code together to interact with the API but Iā€™ve never done a HA integration before. Will probably be most helpful in the Govee API integration layer.

1 Like

Home assistant is pretty good about detailing the steps of how to go about making an integration.

I have an H71731 and this works for me. Has there been any update to get the appliance state? Iā€™d like for my home automation to know if the heater was left on and then turn it off.

There has been!! A completely new API opened up which now gives a lot more information on devices and provides state. Iā€™m still testing but I wouldnā€™t mind providing the calls I have so far.

1 Like

Does the new API require a firmware update to the appliance?