Homematic - reading and displaying the valve state

Hi there,
hopefully this question is not too stupid and I’m using the proper terminology:
Here’s what I want to do:
For no reason I want to display the valve state of a homematic thermostat (HM-CC-RT-DN working with an original CCU2). Here is what I’ve done so far:

1.I introduced my CCU2 to Home Assistant via configuration.yaml

homematic:
    interfaces:
        rf:
            host: 192.168.178.39
            port: 2001
            resolvenames: json
            username: Admin
            password: xxxxxx
        groups:
            host: 192.168.178.39
            port: 9292
            resolvenames: json
            username: Admin
            password: xxxxxx
            path: /groups
      
    hosts:
        ccu2:
            host: 192.168.178.39
            port: 2001
            username: Admin
            password: xxxxxx
  1. That worked so far. Several things (entities, right? ) were discoverd and could be used. As far as I have discoverd, there was no entity created for the valve state (as for the battery state of that thermostat). Nevertheless I want that :slight_smile:.

  2. I read the documentation and came up with that idea:

sensor:
 - platform: template
   sensors:
     my_valve:
       friendly_name: "Ventilstellung"
       value_template: "{{ state_attr('climate.leq0422739', 'valve') }}"
       entity_id: climate.leq0422739
  1. In /config/groups.yaml I put:
default.view:
    view: yes
    name: Home
    entities:
       - sensor.my_valve
  1. Frustrated. The display said “NONE”. Spent reading the docs - but no luck.

So my question is: Am I generally doing it the wrong way? Maybe I need a push in the right direction.
(Running HassOS 3.8 on a Pi)

I have it working like this:

- platform: template
  sensors:
    sz_valve:
      value_template: '{{ states.climate.leq1234567.attributes.valve }}'
      friendly_name: 'Ventilstellung'
      entity_id: climate.leq1234567
      unit_of_measurement: "#"

Hi there and thank you very much for the quick reply.
I tried your code snippet and the displayed value changed from NONE to unknown. Now, that’s possiblby a hint that there may be a problem on the CCU2 side.What do you think?
Thank you anyway - I’m still learnig & working examples are very helpful. Maybe I have to dig into the logs.

So I dug into the logs:

2020-01-30 22:36:21 INFO (Thread-2) [pyhomematic.devicetypes.generic] HMGeneric.event: address=LEQ0782329:4, interface_id=homeassistant-rf, key=VALVE_STATE, value=0

Now, does that mean that the data from the CCU2 was correctly submittet to Home Assistant?

Yes. I guess the sensor will stay at Unknown if there hasn’t been any value change initially. Try what happens when you press the boost-button or lower the target temperature. Anything that makes the valve move. This should be transmitted just like you have seen in the log.

Thanks again for your time - here are the results:

tail /config/home-assistant.log -f | grep VALVE

2020-01-31 17:09:52 INFO (Thread-2) [pyhomematic.devicetypes.generic] HMGeneric.event: address=LEQ0782324:4, interface_id=homeassistant-rf, key=VALVE_STATE, value=89

As you said, the data is transmitted very well. I could watch the VALVE_STATE moving nicely up and down when I initiated BOOST-Mode.
Maybe there is something wrong with my way trying to display the entity. Interesting enough, when I try to add a gauge-card to my home view and select the sensor.my_valve the card says “Entity is non-numeric”.
Maybe there’s a typo somewhere. I will go through it oncemore with a fresh setup. Again, thank you very much - this is very helpful. But I don’t want to bother you. This is not a top-priority problem :slight_smile:

With version Home Assistant OS 7.1 together with RaspberryMatic, I have the following Code, which works fine for all valves in my home:

  - platform: template
    sensors:
      wohnzimmer_valve:
        friendly_name: "Ventilstellung"
        value_template: "{{ state_attr('climate.wohnzimmer_gruppe', 'level') * 100 }}"
        unit_of_measurement: "%"

1 Like

For me it is:


  - platform: template
    sensors:
      wohnzimmer_valve:
        friendly_name: "Ventilstellung"
        value_template: "{{ state_attr('climate.wohnzimmer', 'valve') }}"
        unit_of_measurement: "%"

Hi all,

i have a setup with raspberrymatic and HmIP-eTRV-B valves. Still the valve opening is not transfered to homematic with the climate entities.

Does anyone have a hint how to do that?

Thanks

Search in “Developer Tools - States” for ‘valve’. In my case, all my groups show the ‘valve’ attribute being emtpy.
So one has to read out the valve value from one of the connected HKTs (Heizkörperthermostate) of the group (a group may have up to 7 connected HKTs which all will have the same valve value).

So for me it works with:

  - sensor:
      - name: heizung_valve
        unit_of_measurement: "%"
        state: "{{ state_attr('climate.hkt_buro_andy', 'valve') | int }}"

you can check this beforehand in “Developer Tools - Template”

hth
Andy

Hi everybody,
my apologies already for maybe asking a dumb question.
yes, I am pretty new to HA (used openHab before) and how I am struggling with exactly was is discussed in this thread… but I do not understand your solutions :frowning:

I have my Raspberrymatic connected and setup like @Crevis has stated. Works fine so far, many entities are found and using the “Developer Tools - Template” I could also get a meaningful reading of my valves using
Ventil Heizung Bad: {{ state_attr('climate.002018a997609b', 'level') }}%

But I do not understand how and where to use the code snippets you provided.
Where to put the code you shared, @oe3arc or lopez1de ?
If I place it in the config yaml, i get strange warning (yes, i am also completly new to YAML and basically on’t know what I am doing there… but hey, I was able to connect the homematic :slight_smile: )

Thanks for any support,
cheers
Steffen

Hi,

my snippet is a templated sensor.

I recommend, you start reading here:

hth
Andy

1 Like

I would recommend to switch to the new integration. There you have the option to enable a sensor-entity for the level (disabled by default).

Brief installation instructions can be found here. More detailed instructions (for use with the RaspberryMatic Add-on, but a lot still applies to setups with a dedicated RaspberryMatic host) can be found here.

1 Like

Thanks @oe3arc and @danielperna84,

I managed to get all my Homematic Thermostat levels to show up :slight_smile:

My config.yaml:

template:
  - sensor:
      - name: Heizung Bad oben
        unit_of_measurement: "%"
        state: "{{ state_attr('climate.002018a9a7c83e', 'level')*100 | float }}"
  - sensor:
      - name: ........

Cheers,
Steffen

“There you have the option to enable a sensor-entity for the level (disabled by default)”.

If you’re going to respond to a question, giving the perfect answer, please at least link to where the information is, rather than leave people to fend for themselves (hint: it isn’t easy to find, at least for me)

Hi all,
I search for a solution to get some values from Homematic to home assistant.
my setup:
Home Assistant version 2023.10.5
Add ON RaspberryMatic CCU version: 3.71.12.20231020
Connection HA to HM in configuration.yml with homematic: … interfaces: … hmip: …

I got all my devices from Homematic into home assistant, but not all informations from those devices.
my actual case I have a device “HmIP-BWTH” it is a Homematic IP wall mounted thermostat for floor heating with humidity sensor. I got the sensor in home assistant and also a climate device with additional attributes. but in the attributes I miss the information if the relay is on or off from special channel from this device. this information is needed to knew if the floor is heating right now or not. cause floor heating has no “level” for hot water control. it is open or closed. so the thermostat switch in on or off.

the described solution above is to create my own sensor and grep the state information from the climate device attribute. but how do I get the special attribute I need, if it is not there.

I tried to read the docs from home assistant for homematic but in don’t understand how I can get informations that are not provided by default. maybe someone can help me and also describe how to test this .

as I am on the same run to get the valve reading shown as a sensor, a question to your solution:

The

       'climate.002018a9a7c83e'

out of your code is the name of the thermostate out of the entity-section? I am questioning as my are shown with a clear name like: climate.og_toilet1_hkr1 and not the alphanumeric name as you show.