Hey Guys,
just to share the knowledge:
I wanted to integrate Homematic physical Buttons (e.g. HMIP-WRC2) to set states in Homeassistant (through a binary sensor).
Therefore, I set up the button in homematic, which than, after pressing, changes a system variable in homematic. Therefore I wrote a program in homematic:
If the button is pressed, the System variable changes from 0 to 1:
In hassio, you need to define the sensor in the config.yaml:
homematic:
interfaces:
rf:
host: 192.168.xx.xx
resolvenames: "json"
username: Admin
password: xxx
ip:
host: 192.168.xx.xx
port: xx
resolvenames: json
username: Admin
password: xx
groups:
host: 192.168.xx.xx
port: xx
resolvenames: "json"
username: Admin
password: xx
path: /groups
hosts:
ccu3:
host: 192.168.xx.xx
port: xx
username: Admin
password: xxx
sensor:
- platform: template
sensors:
anwesenheit_willi:
friendly_name: "Willi_anwesend"
value_template: "{{ state_attr('homematic.ccu3', 'Willi_anwesend') }}"
anwesenheit_ossi:
friendly_name: "Oskar_anwesend"
value_template: "{{ state_attr('homematic.ccu3', 'Oskar_anwesend') }}"
After you did this, you will see a sensor in hassio:
From here, you can do whatever you want with this information, For example switch off the heating of your building when you leave the house or switch on/off the light etc etc.
Since there is no simple physical button available to integrate in homeassistant, I did this workaround. Have fun!
Alex