Hi all together,
I’m new to Home Assistant and coming from a combination of Homebridge and IoBroker. I want to replace them and make Home Assistant my central middleware for all my smart home accessories. In my home I’m using Homematic IP for the blinds (HMIPW-DRBL4), the garage door and temperature sensors, Philips Hue for lighting, Doorbird and Unify Protect for the doorbell and cameras.
I set up Home Assistant (on a NUC as operating system) with HACS and homematic_custom which is connected to my RaspberryMatic. All devices and entities from Homematic are available in Home Assistant. The covers are working in Home Assistant, but when I make them available in Homekit they do not work as expected. This is mainly because the integration does not use the COMBINED_PARAMETER of Homematic but sets the position and tilt-positions of the blinds as single values. This is very bad implemented in the DRBL4, a workaround is to use the COMBINED_PARAMETER of that Homematic device to set both similarily.
In IoBroker I found a script which does a custom mapping of the values from Homematic to Homekit and back. This works good for me but is the only reason for me to have IoBroker. The script does mainly following:
The blinds are implemented as covers, so they just have a open and close button and a position slider. They do NOT implement a second tilt slider. When the blinds are opened the COMBINDED_PARAMETER is set to L=100,L2=0. When they are closed its L=0,L2=0. The same is done respectively when the position slider is between 0 and 20 (close), or 80 and 100 (open). Only when the position is set between 21 and 79 the COMBINED_PARAMETER is L=0,L2=50, which keeps the blinds closed but opens the tilts by 50% so that light comes in. In our home we only need this three states for the blinds. In Homekit this works good.
How can I achieve this with Home Assistant. I played around with templates but I don’t come through it. Unfortunately it seems that nobody else has implemented the DRBL4 in a custom entity for that. It would be really nice if you could help me to get this working and to help me to streamline my setup to just Home Assistant.
Thanks for your replies. The problem is that the implementation of the DRBL4 blinds in Home Assistant do not use that COMBINED_PARAMETER of Homematic. When using that blinds in Homekit they are not usable because to get them working properly both values (position and tilt) need to be set. Otherwise for example when opening the blinds they went ab bit down and don’t close complete.
This is what I found out so far. The open, close and stopping is working. What I want now is that the “position” is used for the L2 value of the COMBINED_PARAMETER (at first, later I will bring in some conditions here).
My problem is that I want to use the Value of the current_position in my Template but I do not know how to achieve this. This is my code, the “set_cover_position” is not working. How can I use the position value of the entity here to set the right command to homematic?
Hello SukramJ,
thank you for your reply. That’s true and this is the reason why I want to create a custom entity that I can use in Homekit.
Can you maybe help me with the template I want to create for this special solution? How can I use the current_position in the template to set_cover_position?
Hi,
yes, sorry I think that I wrote that a bit confusing. The Homematic IP (local) implementation in Home Assistant works fine and I also have all covers with both position and tilt sliders.
My plan is to create a second cover entity with limited possibilities and to use them in Homekit. Here I want to use the position slider (and no tilt slider in Homekit, just the position) to control different states for the cover. 0-20 % = close, 21-79% = tilt 50%, 80-100% = open.
So, this is where I came out right now. It works, also in Homekit, but some things are not perfect at the moment. Maybe anybody can help me here a bit?
How can I bring the “device_id” in something like a variable (because I have 11 covers in my home)
How can I change the position to the value I prefer. For example when I change it to 47% it stays at that value. It would be better to set every value between 20 and 79 to 50 %.
When I change it in Homekit it works, but also the position value could be "re"set to 0, 50 or 100 (even when it is between).
- platform: template
covers:
jalousie_wohnzimmer:
device_class: shutter
friendly_name: "Jalousie Wohnzimmer"
open_cover:
- service: homematicip_local.set_device_value
data_template:
device_id: 123455
channel: 6
parameter: COMBINED_PARAMETER
value: L=100,L2=100
close_cover:
- service: homematicip_local.set_device_value
data_template:
device_id: 123455
channel: 6
parameter: COMBINED_PARAMETER
value: L=0,L2=0
stop_cover:
- service: homematicip_local.set_device_value
data_template:
device_id: 123455
channel: 6
parameter: STOP
value: true
set_cover_position:
- service: homematicip_local.set_device_value
data_template:
device_id: 123455
channel: 6
parameter: COMBINED_PARAMETER
value: >
{% if position == none %}
L=0,L2=0
{% elif position | int > 80 %}
L=100,L2=100
{% elif position | int >=20 and position | int < 80 %}
{% set position = 40 | int %}
L=0,L2=40
{% else %}
L=0,L2=0
{% endif %}