For the shutter/blinds/covers there is a nice custom component at homeassistant-rademacher. I use it in combination with ‘rest_command’ to activate scenes.
Hallo, vielen dank, für die Skripte.
Leider tauchen die Sensoren bei mir unter Entwicklerwerkzeuge nicht auf, so dass ich die cover.yaml anpassen könnte.
sensor.yaml
- platform: rest
name: 'Rolladen_WZ_links'
resource: 'http://192.168.2.122/devices/5'
value_template: '{{ 100 - float(value_json["payload"]["device"]["capabilities"][32]["value"]) }}'
scan_interval: 20
rest.yaml
belt_winder_up:
url: 'http://192.168.2.122/devices/{{ did }}'
method: PUT
payload: '{"name":"POS_UP_CMD"}'
belt_winder_down:
url: 'http://192.168.2.122/devices/{{ did }}'
method: PUT
payload: '{"name":"POS_DOWN_CMD"}'
belt_winder_stop:
url: 'http://192.168.2.122/devices/{{ did }}'
method: PUT
payload: '{"name":"STOP_CMD"}'
belt_winder_set_position:
url: 'http://192.168.2.122/devices/{{ did }}'
method: PUT
payload: '{"name":"GOTO_POS_CMD","value":"{{ 100 - float(position)|int }}"}'
Kann mir jemand einen Tipp geben?
Moin @myrhre pass die sensor.yaml mal bitte so an wie es auch in der Anleitung steht.
- platform: rest
name: '[Cover Name] Position'
resource: 'http://[Homepilot IP]/devices/[Device ID]'
value_template: >-
{% for item in value_json.payload.device.capabilities %}
{%- if item.name == "CURR_POS_CFG" -%}
{{ 100 - float(item.value) }}
{%- endif -%}
{% endfor %}
scan_interval: 20
[/quote]
Wenn du die URL im Browser aufrufst, müsste einiges an JSON auftauchen, klappt das?
Hello, At first: thank you for this solution!
I got it working, but unfortunately, my “up” array is still greyed out.
The sensor state is working, also mirroring the opposite value of the one in homepilot.
Going down and to position is working, too.
Edit: Sensor is showing 51%, but the position slider is on 0
Any further ideas? I am on HA 12.3
Best regards, Markus
(Answers in german are ok, too)
See: https://community.home-assistant.io/t/cover-does-not-recognize-positione/369107/3 => Solution
Hey Everyone and merry Christmas,
I search for finding solutions and found this one …
It is a Rademacher solution for iobroker.
Could this be used as a “template”?
I don’t know what you’re trying to do or why you’re linking ioBroker - does the process in the first port not work for you?
If it’s too complicated, scroll around this topic, you’ll find a great custom integration as well, which should be easier to set up.
Hey
I don’t want to to use iobroker. Maybe this was a little misunderstanding.
I already tried out the posted version.
But it is. It including the dimmers and buttons. Only shutters/blinds.
Unlikely I have no clue yet how to use restAPI to integrate the rest.
As far as I know there is no full integration for HA so far - custom or not. Or am I wrong?
Ah, so you’re trying to integrate other devices.
My guess would be that they behave similar to the shutters, but I don’t have any of them to test and to create templates.
If you want to, you can DM me in german as well, would be nice to add support for more devices.
Did anyone tried a shorter scan_interval? Any negativ aspects?
Request overflow?
I flooded the hub with thousands of SSH login attempts per second, I don’t think one request per second will cause any problems.
Hi dexxger,
as already mentioned in my private message to you, I managed to integrate several Rademacher devices into HA (thanks to fedot for the instructions).
I try to summarize my work within the next days and post it to this forum.
My code is not very pretty at the moment but the procedure should be working.
As mentioned before, here is a summary of all Rademacher devices I have included to Home Assistant. Most of the work was done by @fedot I just copy and pasted most of his code with some modifications.
For the shutters and blinds I added the slat or tilt position because I am using venitian blinds at home (Raffstore).
I hope this helps many of you guys.
Shutters and blinds with slat position (e.g. DuoFern Connect-Aktor 9477)
sensor.yaml
- Create a sensor.yaml in your config directory if it doesn’t exist already.
- Add sensor: !include sensor.yaml to your configuration.yaml file, if you haven’t already.
- Add this to your sensor.yaml, replacing:
- [Homepilot IP] with the IP of your Rademacher Hub
- [Device ID] with your device ID
- [Cover Name] with a fitting name like Dining South``
- Repeat this step for each device you want to add.
- platform: rest
name: '[Cover Name] Position'
resource: 'http://[Homepilot IP]/devices/[Device ID]'
value_template: >-
{% for item in value_json.payload.device.capabilities %}
{%- if item.name == "CURR_POS_CFG" -%}
{{ 100 - float(item.value) }}
{%- endif -%}
{% endfor %}
scan_interval: 20
- platform: rest
name: '[Cover Name] Position Tilt'
resource: 'http://[Homepiolt IP]/devices/[Device ID]'
value_template: >-
{% for item in value_json.payload.device.capabilities %}
{%- if item.name == "CURR_SLAT_POS_CFG" -%}
{{ 100 - float(item.value) }}
{%- endif -%}
{% endfor %}
scan_interval: 20
rest_cover.yaml
- Create a rest_cover.yaml in your config directory if it doesn’t exist already.
- Add rest_command: !include rest_cover.yaml to your configuration.yaml file, if you haven’t already.
- Add this to your rest_cover.yaml, replacing:
- [Homepilot IP] with the IP of your Rademacher Hub
- You only need to do this once
belt_winder_up:
url: 'http://[Homepiolt IP]//devices/{{ did }}'
method: PUT
payload: '{"name":"POS_UP_CMD"}'
belt_winder_down:
url: 'http://[Homepiolt IP]//devices/{{ did }}'
method: PUT
payload: '{"name":"POS_DOWN_CMD"}'
belt_winder_up:
url: 'http://[Homepiolt IP]//devices/{{ did }}'
method: PUT
payload: '{"name":"STOP_CMD"}'
belt_winder_set_position:
url: 'http://[Homepiolt IP]//devices/{{ did }}'
method: PUT
payload: '{"name":"GOTO_POS_CMD","value":"{{ 100 - float(position)|int }}"}'
belt_winder_set_tilt_position:
url: 'http://[Homepiolt IP]//devices/{{ did }}'
method: PUT
payload: '{"name":"SET_SLAT_POS_CMD","value":"{{ 100 - float(tilt)|int }}"}'
cover.yaml
- Create a cover.yaml in your config directory if it doesn’t exist already.
- Add cover: !include cover.yaml to your configuration.yaml file, if you haven’t already.
- Add this to your cover.yaml, replacing:
- [cover_name] with a name like dining_south
- [Device ID] with the correct device ID
- [Sensor entity ID] with the entity_id of the matching sensor. Usually it is the same name, lowercase, spaces replaced with an underscore. E.g. sensor.cover_dining_west_position
- If you are not sure what to use here, restart home assistant after step 1 or 2 and search in Developer Tools - States 6 for the newly created sensor.
- [Displayed Name] with the correct name for the cover (This is the one shown in the UI)
- Repeat this step for each device you want to add
- platform: template
covers:
[cover_name]:
device_class: shutter
friendly_name: "Wohnzimmer Raff"
position_template: "{{ states('sensor.wohnzimmer_raff') }}"
tilt_template: "{{ states('sensor.wohnzimmer_raff_tilt') }}"
open_cover:
- service: rest_command.belt_winder_up
data:
did: 52
close_cover:
- service: rest_command.belt_winder_down
data:
did: 52
stop_cover:
- service: rest_command.belt_winder_stop
data:
did: 52
set_cover_position:
- service: rest_command.belt_winder_set_position
data_template:
did: 52
position: "{{position}}"
set_cover_tilt_position:
- service: rest_command.belt_winder_set_tilt_position
data_template:
did: 52
tilt: "{{tilt}}"
Environment sensor (e.g. DuoFern Umweltsensor 9475)
rests.yaml
- Create a rests.yaml in your config directory if it doesn’t exist already.
- Add rest: !include rests.yaml to your configuration.yaml file
- Add this to your rests.yaml, replacing:
- [Homepilot IP] with the IP of your Rademacher Hub.
- [Device ID] with your device ID
- scan_interval: 30
resource: "http://[Homepilot IP]/devices/[Device ID]"
method: GET
sensor:
- name: "Umweltsensor Temperatur"
value_template: '{{ (value_json["payload"]["device"]["capabilities"][24]["value"]) }}'
- name: "Umweltsensor Helligkeit"
value_template: '{{ (value_json["payload"]["device"]["capabilities"][133]["value"]) }}'
- name: "Umweltsensor Wind"
value_template: '{{ (value_json["payload"]["device"]["capabilities"][102]["value"]) }}'
- name: "Umweltsensor Regen"
value_template: '{{ (value_json["payload"]["device"]["capabilities"][71]["value"]) }}'
Please double-check the numbers after [“capabilities”] with your configuration. The easiest way is to open the link http://[Homepilot IP]/devices/[Device ID] with Firefox, where you can see the positions immediately. Check for following entries:
* Temperature: "TEMP_CURR_DEG_MEA"
* Brightness: "CURR_BRIGHTN_CFG"
* Wind: "WIND_SPEED_MS_MEA"
* Rain: "RAIN_DETECTION_MEA"
Mehrfachwandtaster (DuoFern Mehrfachwandtaster 230V 9494-2)
rests.yaml
- Create a rests.yaml in your config directory if it doesn’t exist already.
- Add rest: !include rests.yaml to your configuration.yaml file
- Add this to your rests.yaml, replacing:
- [Homepilot IP] with the IP of your Rademacher Hub.
- [Device ID] with your device ID
- Check for “KEY_PUSH_CHX_EVT” (X is a number from 1 to 6 for the single buttons) in the devices JSON to get the correct position after [“capabilities”]
- scan_interval: 0
resource: "http://[Homepilot IP]/devices/[Device ID]"
method: GET
sensor:
- name: "Taster 1"
value_template: '{{ (value_json["payload"]["device"]["capabilities"][23]["timestamp"]) }}'
- name: "Taster 2"
value_template: '{{ (value_json["payload"]["device"]["capabilities"][33]["timestamp"]) }}'
. . .
and so on for all 6 buttons on the panel
With the buttons as rest sensor, you can combine Rademacher switches with other manufacturer (like Shelly etc.). The easiest way is just adding automations.
I guess a motion sensor (Bewegungsmelder) should work the same way. Just check for “MOTION_DETECTION_MEA” and use [“value”] instead of [“timestamp”].
Switches (z.B. Zwischenstecker oder Aktoren)
switches.yaml
- Create a switches.yaml in your config directory if it doesn’t exist already.
- Add switch: !include switches.yaml to your configuration.yaml file
- Add this to your switches.yaml, replacing:
- [Homepilot IP] with the IP of your Rademacher Hub.
- [Device ID] with your device ID
- platform: rest
resource: "http://[Homepilot IP]/devices/[Device ID]"
method: put
name: "Esszimmer Licht"
body_on: '{ "name": "TURN_ON_CMD" }'
body_off: '{ "name": "TURN_OFF_CMD" }'
is_on_template: '{{ (value_json["payload"]["device"]["capabilities"][29]["value"]) }}'
- platform: rest
resource: "http://[Homepilot IP]/devices/[Device ID]"
method: put
name: "Wohnzimmer Licht"
body_on: '{ "name": "TURN_ON_CMD" }'
body_off: '{ "name": "TURN_OFF_CMD" }'
is_on_template: '{{ (value_json["payload"]["device"]["capabilities"][29]["value"]) }}'
One advantage here, the current state of the switch will be checked as well.
Thanks for the code! I’ll add that to my initial post and maybe a github repo for better visibility if that’s okay for you.
Hey,
for sensor you need to add this:
- platform: rest
name: '[Cover Name] Position'
resource: 'http://[Homepilot IP]/devices/[Device ID]'
value_template: >-
{% for item in value_json.payload.device.capabilities %}
{%- if item.name == "CURR_POS_CFG" -%}
{{ 100 - float(item.value) }}
{%- endif -%}
{% endfor %}
scan_interval: 1
- platform: rest
name: '[Cover Name] Position Tilt'
resource: 'http://[Homepilot IP]/devices/[Device ID]'
value_template: >-
{% for item in value_json.payload.device.capabilities %}
{%- if item.name == "CURR_SLAT_POS_CFG" -%}
{{ 100 - float(item.value) }}
{%- endif -%}
{% endfor %}
scan_interval: 1
Otherwise you will only get the angle cover but no value for the opening.
I also edited the cover with the (for me working) sensor names depending on the sensor name.
- platform: template
covers:
[cover_name]:
device_class: shutter
friendly_name: "Wohnzimmer Raff"
position_template: "{{ states('sensor.[Cover Name]_position') }}"
tilt_template: "{{ states('sensor.[Cover Name]_position_tilt') }}"
open_cover:
- service: rest_command.belt_winder_up
data:
did: [Device ID]
close_cover:
- service: rest_command.belt_winder_down
data:
did: [Device ID]
stop_cover:
- service: rest_command.belt_winder_stop
data:
did: [Device ID]
set_cover_position:
- service: rest_command.belt_winder_set_position
data_template:
did: [Device ID]
position: "{{position}}"
set_cover_tilt_position:
- service: rest_command.belt_winder_set_tilt_position
data_template:
did: [Device ID]
tilt: "{{tilt}}"
Thanks to @fedot and @mathi_kay!!!
I’ve edited my post with your additions, thanks for the hint. Completely forgot the cover position in sensor.yaml
Totally fine for me and definitely a good idea.
Hey together,
with the help of fedor I also integrated my Dimmer Module:
sensor:
- platform: rest
name: ‘Dimmer 1’ # Kannst du auch umbenennen, dann im light: Block die Namen des Sensors anpassen
resource: ‘http://[Homepilot IP]/devices/30’ # [Homepilot IP] ersetzen
value_template: >-
{% for item in value_json.payload.device.capabilities %}
{%- if item.name == “CURR_POS_CFG” -%}
{{ item.value }}
{%- endif -%}
{% endfor %}
scan_interval: 20
light.yaml or config
light:
- platform: template
lights:
garden_light:
friendly_name: "Garten Licht"
level_template: "{{ ((states('sensor.dimmer_1')|int) * 2.55) | round(0) }}"
value_template: "{{ states('sensor.dimmer_1')|int > 0 }}"
turn_on:
service: rest_command.dimmer_on
data:
did: 30
turn_off:
service: rest_command.dimmer_off
data:
did: 30
set_level:
service: rest_command.dimmer_brightness
data_template:
did: 30
brightness: "{{ (brightness / 2.55) | round(0) }}"
rest_commands
rest_command: # Entfernen falls diese Zeile schon existiert bzw. du das in einer extra YAML machst
dimmer_on:
url: ‘http://[Homepilot IP]/devices/{{ did }}’ # [Homepilot IP] ersetzen
method: PUT
payload: ‘{“name”:“TURN_ON_CMD”}’
dimmer_off:
url: ‘http://[Homepilot IP]/devices/{{ did }}’ # [Homepilot IP] ersetzen
method: PUT
payload: ‘{“name”:“TURN_OFF_CMD”}’
dimmer_brightness:
url: ‘http://[Homepilot IP]/devices/{{ did }}’ # [Homepilot IP] ersetzen
method: PUT
payload: ‘{“name”:“GOTO_POS_CMD”,“value”:“{{ brightness }}”}’
Hey together,
i´ve added the files as shown on top of this post and get the following error when i check the config:
Invalid config for [rest]: [belt_winder_up] is an invalid option for [rest]. Check: rest->rest->0->belt_winder_up. (See /config/configuration.yaml, line 39).
Can somebody help? Thanks for your support.
You either have to create an extra yaml file and include it rest_command: !include rest.yaml
Or just put rest_command:
into your configuration.yaml and add the block underneath.
Please re-read step 2.
If you’re already using rest.yaml for something different, just create a file with a different name like rest_command.yaml
and include that one.
Hi @mathi_kay,
Thanks for your input
Mehrfachwandtaster (DuoFern Mehrfachwandtaster)
I just modified it a little bit to avoid counting items in the capabilities-array:
- scan_interval: 0
resource: "http://[Homepilot IP]/devices/[Device ID]"
method: GET
sensor:
- name: "Taster 1"
value_template: >-
{% for item in value_json.payload.device.capabilities %}
{%- if item.name == "KEY_PUSH_CH1_EVT" -%}
{{ float(item.timestamp) }}
{%- endif -%}
{% endfor %}
- name: "Taster 2"
value_template: >-
{% for item in value_json.payload.device.capabilities %}
{%- if item.name == "KEY_PUSH_CH2_EVT" -%}
{{ float(item.timestamp) }}
{%- endif -%}
{% endfor %}
- name: "Taster 3"
value_template: >-
{% for item in value_json.payload.device.capabilities %}
{%- if item.name == "KEY_PUSH_CH3_EVT" -%}
{{ float(item.timestamp) }}
{%- endif -%}
{% endfor %}
- name: "Taster 4"
value_template: >-
{% for item in value_json.payload.device.capabilities %}
{%- if item.name == "KEY_PUSH_CH4_EVT" -%}
{{ float(item.timestamp) }}
{%- endif -%}
{% endfor %}
- name: "Taster 5"
value_template: >-
{% for item in value_json.payload.device.capabilities %}
{%- if item.name == "KEY_PUSH_CH5_EVT" -%}
{{ float(item.timestamp) }}
{%- endif -%}
{% endfor %}
- name: "Taster 6"
value_template: >-
{% for item in value_json.payload.device.capabilities %}
{%- if item.name == "KEY_PUSH_CH6_EVT" -%}
{{ float(item.timestamp) }}
{%- endif -%}
{% endfor %}
Switches (z.B. Zwischenstecker oder Aktoren)
- platform: rest
resource: "http://[Homepilot IP]/devices/[Device ID]"
method: put
name: "Wohnzimmer Licht"
body_on: '{ "name": "TURN_ON_CMD" }'
body_off: '{ "name": "TURN_OFF_CMD" }'
is_on_template: >-
{% for item in value_json.payload.device.capabilities %}
{%- if item.name == "CURR_SWITCH_POS_CFG" -%}
{% if item.value == "true" %}
True
{% else %}
False
{% endif %}
{%- endif -%}
{% endfor %}
and if the switch is for a light, I added a ligth-switch:
light:
- platform: switch
name: Wohnzimmer Licht
entity_id: switch.wohnzimmer_licht
perhaps, that’s helpful for the community.
In my current project, I created a PowerShell-script to create sensors and covers for Rademacher-Covers using the device.json you can obtain from your homepilot.
Just download and store that json from http://[Homepilot IP]/devices in the script-directory.
Then open “CreateRademacherCoverInfos.ps1” in ISE or Visual Studio code.
Change the variables in the first region
# basepath - working directory
$basepath = "D:\temp\rademacher"
# Name of json-File from homepilot, get it from http://[Homepilot IP]/devices and save it
$devicesJSONFileName = "Rademacher-Devices.json"
# parts of devicenames, that should be excluded, e.g. switche, ligths, ...
$excludeNamesContaining = @("stecker", "duofern", "licht", "leucht")
# Homepilot-IP
$homepilotIP = "192.168.66.99"
The basepath should be the path, where you stored the json-file and where the yml-files will be created.
If you want to exclude some devices, like lights, you can use the excludeNamesContaining-array.
Then add you own homepilot-IP and start the script.