HOW-TO: Control your Ouman EH-800 heating controller using Home Assistant

I think Home Assistant 2023.12.2 core update need some chance to ouman code. Every measurements are unknow.

  • platform: command_line
    name: Ouman_menopyyntö
    command: ‘curl “http://192.168.0.98:60098/request?S_275_85” | cut -d “:” -f 2 | cut -d “;” -f 1 | cut -b 18-’
    unit_of_measurement: “°C”
    That old code is not works any more. What I must do. What I must chance.

@mikkeli

Soooo long since I put this all up but my setup is working still, this is what I have (sorry if something is wrong, trying to remember it all on the fly)

  1. Create a shell_command in /homeassistant/configuration.yaml

(replace ip, port, username & password with your values)

shell_command:
    ouman_logon: 'curl "http://ip.ip.ip.ip:port/login?uid=USERNAME;pwd=PASSWORD;" > /dev/null'
  1. Create a automation that logs into Ouman “every now and then”

(I have no clue if 2 minutes are to often but it works for me)

alias: Log on to Ouman-EH800
trigger:
  - platform: time_pattern
    minutes: "2"
    alias: Log on every 2 minutes
condition: []
action:
  - service: shell_command.ouman_logon
    data: {}
mode: single
  1. Then create all the sensors you want under /homeassistant/configuration.yaml

Example

command_line:
  - sensor:
        name: Ouman EH800 - Temperatur Outside
        command: 'curl "http://ip.ip.ip.ip:port/request?S_227_85" | cut -d '';'' -f 1 | cut -b 18-'
        unit_of_measurement: "°C"
        state_class: measurement
        unique_id: sensor.ouman_eh800_temperatur_outside

Again, this might not be the best or recommended way to do it but it works for me for now at least.

Like @honkkkis mentioned about a month ago, it might be a good time to start a new thread or somehow clean this one up or a github page or something to better keep track of everything.

If someone sees anything wrong with my setup please let me know but I think this is all I have.

1 Like

Hi! I’ve been trying to implement Ouman EH-800 valve control to my Home Assistant instance and I have managed to get sensors working. For some reason, I am not able to get switches work. I have explored Ouman’s web interface via browsers devtool, but I haven’t found solution for this.

Here’s example from my command_line.yaml where sensors are working like a charm, but switch is not changing the state at all. What is wrong with my yaml?

- switch:
    name: Lattialämmitys kotona-poissa
    unique_id: lattia_kotonapoissa
    command_on: curl "{{ states('input_text.ouman_eh800_ip')}}update?S_135_85=1;"
    command_off: curl "{{ states('input_text.ouman_eh800_ip')}}update?S_135_85=0;"
    command_state: curl "{{ states('input_text.ouman_eh800_ip')}}request?S_135_85" | cut -d "=" -f2 | cut -d ";" -f1
    value_template: '{{ value == "1" }}'


- sensor:
    name: Lattialämmitys tila
    command: curl "{{ states('input_text.ouman_eh800_ip')}}request?S_135_85" | cut -d "=" -f2 | cut -d ";" -f1

- sensor:
    name: Ulkolämpötila eh800
    command: curl "{{ states('input_text.ouman_eh800_ip')}}request?S_227_85" | cut -d "=" -f2 | cut -d ";" -f1
    unit_of_measurement: "°C"

One more thing, I have written everything I’ve done to this repo: https://github.com/mhumaloja/ouman_eh-800_HA/ is this potential way to develop this further in cooperation? I will open the repository to developers who would like to conribute.

Hi,

Here are examples of my two working switches that controls the valve operational mode for the Ouman itself and the extra valve via EXU-800

The radiator one is the EXU-800

The 100% value in the name of the swtich is not changed by HA or this switch, the Ouman remembers the last value set in the GUI so it just goes back to that value when that operating mode is selected, I have not tried to control the % value via HA since I have not had any use for it, I guess it should not be to hard to fix it if needed.

In /homeassistant/configuration.yaml

  - switch:
      name: Ouman EH800 - Radiator Vavle Mode (ON = Auto // Off = 100% Open)
      command_on: curl "http://ip.ip.ip.ip:port/update?S_146_85=0;"
      command_off: curl "http://ip.ip.ip.ip:port/update?S_146_85=6;"
      scan_interval: 120
      command_state: curl http://ip.ip.ip.ip:port/request?S_146_85 --output - | cut -d ';' -f 1 | cut -b 18-
      value_template: >
        {% if value == "0" %}
            true
        {% else %}
            false
         {% endif %}
      unique_id: E5E8BA24-E094-8152-C2EB-3E3A03444A6A4

  - switch:
      name: Ouman EH800 - Floorheating Vavle Mode (ON = Auto // Off = 100% Open)
      command_on: curl "http://ip.ip.ip.ip:port/update?S_59_85=0;"
      command_off: curl "http://ip.ip.ip.ip:port/update?S_59_85=6;"
      scan_interval: 120
      command_state: curl http://ip.ip.ip.ip:port/request?S_59_85 --output - | cut -d ';' -f 1 | cut -b 17-
      value_template: >
        {% if value == "0" %}
            true
        {% else %}
            false
         {% endif %}
      unique_id: E6E8CE83-E741-1122-E3BE-6E3C03214B6A5

Regarding Github I think that might be the best way forward when keeping track of everything, I have very little / no experience with maintaining a repository there but willing try try and learn how to @mhumaloja

EDIT

here is also a example of how I configure sensors

command_line:
  - sensor:
        name: Ouman EH800 - Temperature Outside
        command: 'curl "http://ip.ip.ip.ip:port/request?S_227_85" | cut -d '';'' -f 1 | cut -b 18-'
        unit_of_measurement: "°C"
        state_class: measurement
        unique_id: b25ef358-72d9-4ceb-8e5d-eedc2c4170ac

One thing you want to include is the “state_class”, at least I think that is needed to automatically get the long term statistics working, I recently added this since I did not have it from the start, I noticed you did not have that one as well so hopefully it’s helpful information.

This is very frustrating… I tried to copy your switch like this:

- switch:
      name: Lattialämmitys kotona-poissa
      command_on: curl "{{ states('input_text.ouman_eh800_ip')}}update?S_135_85=1;"
      command_off: curl "{{ states('input_text.ouman_eh800_ip')}}update?S_135_85=0;"
      scan_interval: 120
      command_state: curl "{{ states('input_text.ouman_eh800_ip')}}request?S_135_85" --output - | cut -d "=" -f2 | cut -d ";" -f1
      value_template: >
        {% if value == "1" %}
            true
        {% else %}
            false
         {% endif %}
      unique_id: lattia_kotonapoissa

And it is not working…

I’m more than happy to invite you to administrate the repository if you want to hop on?

  - switch:
      name: Ouman EH800 - Home / Away (Off = Away // On = Home)
      command_on: curl "http://192.168.0.60:54345/update?S_135_85=0;"
      command_off: curl "http://192.168.0.60:54345/update?S_135_85=1;"
      scan_interval: 120
      command_state: curl http://192.168.0.60:54345/request?S_135_85 --output - | cut -d ';' -f 1 | cut -b 18-
      value_template: >
        {% if value == "0" %}
            true
        {% else %}
            false
         {% endif %}
      unique_id: A8E9CE82-A131-2214-EE7E-7E3D43414BAA6

That one works for me to control home / away, have not tried the way you do it with the edited curl parts, try mine without any edits just to verify it works before you try it your way.

Regarding Github, I need to sit myself down some evening to look into how it works, I will try and create my own hidden repo first, then I can help edit yours when I know how to :slight_smile: I will get back to you on that one, in the meantime feel free to copy and use all my examples on your repo.

Nope, doesn’t work. All request? type curl commands are working but update? are not. Login shoud be ok because requests are working. I have sensor and binary sensor for request?S_135_85 and I tried to disable them. No effect, still not working. I have a dead end with this…

Then I have no real clue what could be wrong, I checked in GUI on the Ouman when I used the switch and it changed there so it must be working, at least for me.

Maybe some difference between our Oumans? Mine is quite old I think. not sure how old without checking at home (at work now), I am quite sure tho it’s running software 2.0.4, in case you have something else I guess there’s a possibility it works differently from mine.

As a side note I tried to change the automation that runs the “shell_command.ouman_logon” to 20 minutes (instead of 2), no issues so far so the login timeout is at least 20+ minutes.

@mhumaloja - I checked again and noticed a small mistake in my code for the “command_state”… sorry for that, I have updated my previous post so please check it again.

Issue was “cut -b 17-” in the end needs to be “cut -b 18-” instead, mistake was made since I copied a switch for the “?S_59_85” value, there is 1 character less than in that than in “?S_135_85”… so the result was all messed up and therefore the “command_state” did not work, I was to quick when checking that yesterday… sorry for that.

I have now verified it works for me, if I update from HA by toggling the switch it updates in Ouman GUI and if I manually change in Ouman GUI it updates the switch also in HA after “scan_interval: 120” has triggered.

Something changed with this. Earlier if I toggled the switch in HA UI it switched back after a moment. Now switch keeps the state ONCE but if I toggle it back off it switches back on itself. And it does not change the setting in Ouman WebUI. This is very Weird. It looks like the curl command is not authorized or something…

Something changed with this. Earlier if I toggled the switch in HA UI it switched back after a moment.

Yes, this is due to the error I mentioned where I had “cut -b 17-” in the end but it needs to be “cut -b 18-”

To show what happens,

curl http://ip.ip.ip.ip:port/request?S_135_85 --output - | cut -d ';' -f 1 | cut -b 17-
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100    20    0    20    0     0   3258      0 --:--:-- --:--:-- --:--:--  3333
=0

If you look above I run with “cut -b 17-”, the reply on the last line is “=0”, so the value_template becomes false since the reply does not match the true statement

If I however use

curl http://ip.ip.ip.ip:port/request?S_135_85 --output - | cut -d ';' -f 1 | cut -b 18-
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100    20    0    20    0     0   2911      0 --:--:-- --:--:-- --:--:--  3333
0

You see the reply is now only “0” when I use “cut -b 18-” instead, so the reply now have a value which = true according to the if / else value_template, so the switch will stay on.

And it does not change the setting in Ouman WebUI. This is very Weird. It looks like the curl command is not authorized or something…

Have you checked in the Ouman GUI that the Home / Away boxes really does have “?S_135_85” as it’s register? Otherwise I can’t think of anything right now that could case the issue as long as you test with my example, I described here how I check the registers.

I understood this cut operation error. Register is right according to the Ouman webUI, it is showing 135_85 as an url request in dev tool network tab. I’m turning to think that my trial and error development approach has made something deeper thing to my Home Assistant database or entity structure. I will try to delete all 135_85 related sensors and switches out of my installation and then try to put the switch back again with your code.

1 Like

Ok, good luck with that, hope you figure it out! I will be quite AFK this weekend but will check in now and then to see if you have any questions.

Made a short video just to show how the switch works for me, “wrong” language :wink: but “Hemma” means home and “Borta” means away, “Inte H/B -styrn.” is no home / away control.

You can’t see the cursor… but at first I click the button i HA, then I change in Ouman GUI and after some time the switch reflects the change.

Screencast 2024-02-16 21:15:25

Thanks for clear instructions, testing this now.

But as a side note, missing /. time_pattern: minutes: “2” will trigger once per hour, “/2” would trigger every 2 minutes.

I just went with @mhumaloja git repo and all seems good, great, thanks!

Then I started to debug a little that switch and got similar experience as Markus. First I noticed, that for some reason curl “{{ states(‘input_text.ouman_eh800_ip’)}}update?S_134_85=5;” notation doesn’t work, get error in the logs. Looks like it never expands that input_text.ouman part. But it does work with the sensors. Weird.

But anyway, I noticed the same odd behaviour and it seemed that double clicking the switch always worked. With single click every other command went through, and the switch in HA sometimes reverted back even the command went through.

Then I played little with the value_template, and ended up with this, and now it seems to work: (True / false → On / Off)

    name: Ouman home-away switch
    unique_id: Ouman home-away switch
    command_on: curl "http://192.168.1.6/update?S_135_85=1;"                      
    command_off: curl "http://192.168.1.6/update?S_135_85=0;"                      
    scan_interval: 30                                                              
    command_state: curl "http://192.168.1.6/request?S_135_85" | cut -d "=" -f2 | cut -d ";" -f1                      
    value_template: >                                                                                                
      {% if value == "0" %}                                                                                          
        on                                                                                                    
      {% else %}                         
        off                
      {% endif %}
type or paste code here

And thanks for the git repo, cleared things a lot!

1 Like

Nice that it works! For me at least my example works just fine.

I have started to look some at Github, I have made my own repo just to learn how things work, I have not made it public yet but once I feel ready I will do that, if we decide to go for mine or @mhumaloja does not matter to me, I just wanted to learn a bit about Github at the same time before I maybe edit other peoples repo’s.

Good work @Belaial and @mhumaloja! This project definitely deserves some kind managed environment for maintenance and developmet, HA gets frequently changes that make pure forum impractical.

If someone has find out more complete register list, it might be worth publishing. Earlier lists are from maalampopumput.info etc, and it seems to be, that there might be partially incorrect information. Some members have been obviously able to find more registers, since they have extension units (EXU/EXP) and two circuits.

Here is my take on creating a Github repository for Ouman EH-800

Please have a look, let me know if you find anything horribly wrong… Translations under registers.txt might need some re-working… I added the registers I have personally found and reformatted the list to be in a more logical order than the original list, now sorted numerically instead of whatever the original list was :smile:

1 Like

Thanks @Jusii for trying to solve my problem. I copied your code to my command_line.yaml and switch is still behaving like before. Can you help me debug this thing? Is there some tool or HA developer feature that I can debug switches behaviour? I’m starting to think that my database is having some garbage in this switch data or something deeper than just the yaml code…

I checked logs. I seems that switch command is timed out. If I set command_timeout 30 or more logs show error with return code 56. I will try to figure out what it is…