Integration of HUUM UKU Wifi

Great - work, I’ll implement today on mine and let you know how it goes

I did also ping Huum, and ask about a local integration. The response was just “no, it requires wifi” so I’m not sure how technical the person was. Not sure how to make a formal request vs. just emailing their support, I can’t imagine they are that big of a company.

This may be to do with the different double-quotes you are using. I see that happen with mac computers trying to change them sometimes, trying to be clever, but it actually just messes it up.

You have:
sauna_off: ‘curl -X POST “https://mail:[email protected]/action/home/stop”’

But it should be:
sauna_off: 'curl -X POST "https://mail:[email protected]/action/home/stop"'

This worked great for me - updated code below (with unique_ids for area assignment) and as @Razor109 mentions you can dump the scripts.yaml and automations.yaml code. Only thing needed is adding the below to configuration.yaml

I am thinking it might be feasible to get rid of the shell commands and go straight rest but haven’t started to play around with that. I’d love to reduce the number of places my email and password is all over the yaml…

If I get some time this weekend I will dig into trying to get the target temp slider in degrees F vs. C

shell_command:
  sauna_light_toggle: 'curl "https://<EMAIL>%40gmail.com:<PASSWORD>@api.huum.eu/action/home/light"'
  sauna_off: curl -X POST https://<EMAIL>%40gmail.com:<PASSWORD>@api.huum.eu/action/home/stop

rest_command:
  sauna_on:
    url: https://api.huum.eu/action/home/start
    username: <EMAIL>
    password: <PASSWORD>
    payload: '{"targetTemperature":{{ states("input_number.temperaturesauna")|int }} }'
    verify_ssl: true
    content_type: application/json
    method: post

sensor:

  - platform: rest
    resource: https://api.huum.eu/action/home/status
    username: <EMAIL>
    password: <PASSWORD>
    authentication: basic
    unique_id: sauna_rest_status_2272022
    scan_interval: 60
    name: sauna_status
    value_template: "OK"
    json_attributes:
      - door
      - temperature
      - targetTemperature
      - statusCode
      - light

  - platform: template
    sensors:
      sauna_temperature:
        unique_id: sauna_temperature_2272023
        value_template: "{{ state_attr('sensor.sauna_status', 'temperature') }}"
        device_class: temperature
        unit_of_measurement: °C
    
      sauna_target_temperature:
        unique_id: sauna_target_temperature_2272023
        value_template: "{{ state_attr('sensor.sauna_status', 'targetTemperature') }}"
        device_class: temperature
        unit_of_measurement: °C
    
      sauna_door:
        unique_id: sauna_door_2272023
        value_template: >-
          {% set state = state_attr('sensor.sauna_status', 'door') %}
          {% if state == true %}Closed
          {% elif state == false %}Open
          {% else %}Unknown{% endif %}
    
      sauna_light:
        unique_id: sauna_light_2272023
        value_template: >-
          {% set state = state_attr('sensor.sauna_status', 'light') %}
          {% if state == 0 %}off
          {% elif state == 1 %}on
          {% else %}Unknown{% endif %}

      sauna_statuscode:
        unique_id: sauna_statuscode_2272023
        value_template: >-
          {% set state = state_attr('sensor.sauna_status', 'statusCode') %}
          {% if state == 230 %}Offline
          {% elif state == 231 %}on
          {% elif state == 232 %}off
          {% elif state == 233 %}Blocked
          {% elif state == 240 %}Emergency       
          {% else %}Unknown{% endif %}

light:
  - platform: template
    lights:
      saunalight:
        unique_id: sauna_light_2272023
        friendly_name: "Sauna Light"
        value_template: >-
          {% set state = state_attr('sensor.sauna_status', 'light') %}
          {% if state == 0 %}Off
          {% elif state == 1 %}On
          {% else %}Unknown{% endif %}
        turn_on:
          - service: shell_command.sauna_light_toggle
          - delay: 00:00:01
          - service: homeassistant.update_entity
            target:
               entity_id: sensor.sauna_status
        turn_off:
          - service: shell_command.sauna_light_toggle
          - delay: 00:00:01
          - service: homeassistant.update_entity
            target:
               entity_id: sensor.sauna_status

switch:
  - platform: template
    switches:
      sauna:
        unique_id: sauna_heater_2272023
        friendly_name: "Sauna Heater"
        value_template: >-
          {% set state = state_attr('sensor.sauna_status', 'statusCode') %}
          {% if state == 230 %}Offline
          {% elif state == 231 %}On
          {% elif state == 232 %}Off
          {% elif state == 233 %}Blocked
          {% elif state == 240 %}Emergency       
          {% else %}Unknown{% endif %}
        turn_on:
          - service: rest_command.sauna_on
          - delay: 00:00:01
          - service: homeassistant.update_entity
            target:
               entity_id: sensor.sauna_status
        turn_off:
          - service: shell_command.sauna_off
          - delay: 00:00:01
          - service: homeassistant.update_entity
            target:
               entity_id: sensor.sauna_status

input_number:
  temperaturesauna:
    name: Sauna Set Temperature
    initial: 75
    min: 41
    max: 108
    step: 1

Here’s my dash - based heavily off @fireheadman’s

type: vertical-stack
cards:
  - card:
    type: entities
    title: Sauna
    icon: mdi:radiator
    show_header_toggle: false
    entities:
      - entity: sensor.sauna_door
        name: Door
      - entity: sensor.sauna_statuscode
        name: Status
      - entity: light.sauna
        name: Light
      - entity: switch.sauna
        icon: mdi:radiator
      - entity: input_number.temperaturesauna
        name: Sauna Set Temperature (°C)
        icon: mdi:gauge
  - type: horizontal-stack
    cards:
      - type: conditional
        conditions:
          - entity: sensor.sauna_target_temperature
            state_not: unknown
        card:
          type: gauge
          entity: sensor.sauna_target_temperature
          max: 190
          min: 45
          name: Target Temp
          segments:
            - from: 190
              color: '#ff0d00'
            - from: 185
              color: '#ff1a00'
            - from: 180
              color: '#ff2600'
            - from: 175
              color: '#ff3300'
            - from: 170
              color: '#ff4000'
            - from: 165
              color: '#ff4c00'
            - from: 160
              color: '#ff5900'
            - from: 155
              color: '#ff6600'
            - from: 150
              color: '#ff7300'
            - from: 145
              color: '#ff8000'
            - from: 140
              color: '#ff8c00'
            - from: 135
              color: '#ff9900'
            - from: 130
              color: '#ffa600'
            - from: 125
              color: '#ffb200'
            - from: 120
              color: '#ffbf00'
            - from: 115
              color: '#ffcc00'
            - from: 110
              color: '#ffd900'
            - from: 105
              color: '#ffe600'
            - from: 100
              color: '#fff200'
            - from: 97
              color: '#ffff00'
            - from: 95
              color: '#ffff00'
            - from: 90
              color: '#f2ff00'
            - from: 87
              color: '#e6ff00'
            - from: 85
              color: '#d9ff00'
            - from: 80
              color: '#ccff00'
            - from: 77
              color: '#bfff00'
            - from: 75
              color: '#b2ff00'
            - from: 70
              color: '#a6ff00'
            - from: 67
              color: '#99ff00'
            - from: 65
              color: '#8cff00'
            - from: 60
              color: '#80ff00'
            - from: 57
              color: '#73ff00'
            - from: 55
              color: '#66ff00'
            - from: 50
              color: '#59ff00'
            - from: 47
              color: '#4dff00'
            - from: 45
              color: '#40ff00'
            - from: 40
              color: '#33ff00'
            - from: 37
              color: '#26ff00'
            - from: 35
              color: '#19ff00'
            - from: 30
              color: '#0dff00'
          needle: true
      - type: gauge
        entity: sensor.sauna_temperature
        max: 190
        min: 45
        name: Current Temp
        segments:
          - from: 190
            color: '#ff0d00'
          - from: 185
            color: '#ff1a00'
          - from: 180
            color: '#ff2600'
          - from: 175
            color: '#ff3300'
          - from: 170
            color: '#ff4000'
          - from: 165
            color: '#ff4c00'
          - from: 160
            color: '#ff5900'
          - from: 155
            color: '#ff6600'
          - from: 150
            color: '#ff7300'
          - from: 145
            color: '#ff8000'
          - from: 140
            color: '#ff8c00'
          - from: 135
            color: '#ff9900'
          - from: 130
            color: '#ffa600'
          - from: 125
            color: '#ffb200'
          - from: 120
            color: '#ffbf00'
          - from: 115
            color: '#ffcc00'
          - from: 110
            color: '#ffd900'
          - from: 105
            color: '#ffe600'
          - from: 100
            color: '#fff200'
          - from: 97
            color: '#ffff00'
          - from: 95
            color: '#ffff00'
          - from: 90
            color: '#f2ff00'
          - from: 87
            color: '#e6ff00'
          - from: 85
            color: '#d9ff00'
          - from: 80
            color: '#ccff00'
          - from: 77
            color: '#bfff00'
          - from: 75
            color: '#b2ff00'
          - from: 70
            color: '#a6ff00'
          - from: 67
            color: '#99ff00'
          - from: 65
            color: '#8cff00'
          - from: 60
            color: '#80ff00'
          - from: 57
            color: '#73ff00'
          - from: 55
            color: '#66ff00'
          - from: 50
            color: '#59ff00'
          - from: 47
            color: '#4dff00'
          - from: 45
            color: '#40ff00'
          - from: 40
            color: '#33ff00'
          - from: 37
            color: '#26ff00'
          - from: 35
            color: '#19ff00'
          - from: 30
            color: '#0dff00'
        needle: true

I’m working on trying to sort out how to let the input slider be in F instead of C knowing that the HUUM API expects C… I’m not in a position to test this at the moment and fully admit my YAML is horrific but would something along these lines work? The first line is what works now getting an input already in C but if I switched the input to be in F, could it not simply be converted at submission? Again, potentially completely wrong here (wouldn’t surprise me if syntax is way off as well) and welcome input from smarter folks than I.

payload: '{"targetTemperature":{{ states("input_number.temperaturesauna")|int }} }'
### payload: '{"targetTemperature":{{ states((("input_number.temperaturesauna")-32)*5/9)|int }} }' ###

Will give this a test tomorrow and report back if it works but figured I’d post here in the event someone sees something glaring and can help.

This doesn’t work - probably need a python helper or something to do this properly

try this

rest_command:
  sauna_on:
    url: https://api.huum.eu/action/home/start
    username: !secret huumemail
    password: !secret huumpass
    payload: '{"targetTemperature":{{ (( states("input_number.temperatuursauna") | float ) -32) *5/9 }} }'
    verify_ssl: true
    content_type: application/json
    method: post


input_number:
  temperatuursauna:
    name: Sauna Temperatuur
    initial: 167
    min: 106
    max: 226
    step: 1

tested it this works for me, although sensor.sauna_temperature and sensor.sauna_target_temperature will still be in C. You can use the same template in the sensor.template to make them in F as well.

liking the new comments… planning on applying the same code updates to mine this week and testing it out. I’m all for streamlining the huum integration.

Thanks - this works - I don’t use the !secret bit - what is that function? Does it let me obfuscate my email and password a bit more from some of these files? I’m very much in favor of it if so.

yes just make a secrets.yaml file.

# Use this file to store secrets like usernames and passwords.
# Learn more at https://www.home-assistant.io/docs/configuration/secrets/
huumemail: ********@gmail.com
huumpass: ********

see Storing secrets - Home Assistant

unsure what version of HA you are running…
but value_template is deprecated
it must use state now.

should be seeing this in your logs:

> [value_template] is an invalid option for [template]

ignore that last comment… I may have had a typo in my config somewhere (sorted that out).

@Razor109
by disabling the light, switch, and input_boolean, I noticed you have the the light and sauna switch grayed out now, which is what I see on my side now also.

So how are you controlling the sauna on/off and light?

I had to re-enable my door and light sensor… which btw are both binary sensors (true/false), not sure how you guys are making these load/work as non-binary sensors ?

did you update the whole code? the next part is the light template and the switch template.

light:
  - platform: template
    lights:
      saunalight:
        unique_id: sauna_light_2272023
        friendly_name: "Sauna Light"
        value_template: >-
          {% set state = state_attr('sensor.sauna_status', 'light') %}
          {% if state == 0 %}Off
          {% elif state == 1 %}On
          {% else %}Unknown{% endif %}
        turn_on:
          - service: shell_command.sauna_light_toggle
          - delay: 00:00:01
          - service: homeassistant.update_entity
            target:
               entity_id: sensor.sauna_status
        turn_off:
          - service: shell_command.sauna_light_toggle
          - delay: 00:00:01
          - service: homeassistant.update_entity
            target:
               entity_id: sensor.sauna_status

switch:
  - platform: template
    switches:
      sauna:
        unique_id: sauna_heater_2272023
        friendly_name: "Sauna Heater"
        value_template: >-
          {% set state = state_attr('sensor.sauna_status', 'statusCode') %}
          {% if state == 230 %}Offline
          {% elif state == 231 %}On
          {% elif state == 232 %}Off
          {% elif state == 233 %}Blocked
          {% elif state == 240 %}Emergency       
          {% else %}Unknown{% endif %}
        turn_on:
          - service: rest_command.sauna_on
          - delay: 00:00:01
          - service: homeassistant.update_entity
            target:
               entity_id: sensor.sauna_status
        turn_off:
          - service: shell_command.sauna_off
          - delay: 00:00:01
          - service: homeassistant.update_entity
            target:
               entity_id: sensor.sauna_status

think I have it working now…

I run a split config (yaml)… so lots of files for me.
some of which I have thought about pushing into the UI Helper section once they offer full functionality

If you see something in there that could be deleted… let me know

  • /config/entities/
    • lights/huum_light.yaml (Sauna lights on/off via shell command)
    • switches/huum_switch.yaml (Switch to turn on/off sauna via rest command)
    • input_numbers/huum_input_number.yaml (Slider to set sauna temp)
    • sensors/huum_rest.yaml (Main sauna sensor to get status codes/light/door/temp via REST)
    • rest_command/huum_rest_command.yaml (Login creds to start sauna)
    • templates/huum/
      • huum_target_temperature.yaml (Fahrenheit sensor from sensor.sauna_status - target)
      • huum_temperature.yaml (Fahrenheit sensor from sensor.sauna_status - current)
      • sauna_door.yaml (Door status from sensor.sauna_status)
      • sauna_statuscode.yaml (Status codes from sensor.sauna_status)
      • sauna_target_temperature.yaml (Celius sensor sensor.sauna_status - target)
      • sauna_temperature.yaml (Celsius sensor from sensor.sauna_status - current)

Removed 4 scripts (sauna_light_toggle, sauna_off, sauna_lamp_off, sauna_lamp_on)
Do have 1 automation to alert me when target temp is reached

alias: "-Alert - Sauna has reached target temperature"
description: ""
trigger:
  - platform: template
    value_template: >-
      {{states('sensor.sauna_temperature') | float ==
      states('sensor.sauna_target_temperature') | float}}
condition:
  - condition: state
    entity_id: sensor.sauna_status_code
    state: "on"
action:
  - service: notify.notify
    data:
      message: Target temperature has been reached
      title: Sauna is Ready
mode: single

BTW, if anyone wants to get rid of the shell commands… all three rest_commands work:

rest_command:
  sauna_on:
    url: https://api.huum.eu/action/home/start
    username: !secret huumemail
    password: !secret huumpass
    payload: '{"targetTemperature":{{ states("input_number.sauna_target_temperature")|int }} }'
    verify_ssl: true
    content_type: application/json
    method: post
  sauna_off:
    url: https://api.huum.eu/action/home/stop
    username: !secret huumemail
    password: !secret huumpass
    verify_ssl: true
    content_type: application/json
    method: post
  sauna_light_toggle:
    url: https://api.huum.eu/action/home/light
    username: !secret huumemail
    password: !secret huumpass
    verify_ssl: true
    content_type: application/json
    method: get

Hello,

Any news on this? I still didn’t buy my sauna but am planning on buying it and would really much prefer a local integration.

Thanks.

so noticed today my HUUM isn’t showing anything in HA.
The HUUM app works fine, but the API connections to HA do not seem to be updating the sensors in HA anymore.

Anyone else have issues with access to the API?

https://api.huum.eu

{
    "state": {
        "code": 404,
        "message": "Error 404. Page not found."
    }
}

EDIT: I take that back… because this works
api.huum.eu/action/home/status

…so reviewing my configuration more.
Found my issue… I added a customize.yaml to my split configuration, which is somehow taking out all of my huum entities. Very strange.

Anyone following this? Was supposed to be the huum integration. But it dies from no response. Wills be great to see it into HA formally.

Let’s give that one another go @fireheadman

3 Likes

I’m in when you need a tester

Here is the integration thread for most recent updates…
Add Huum integration by frwickst · Pull Request #106420 · home-assistant/core (github.com)

Not sure if it will help to have more interest in here to bump home assistant devs to get this approved?