Just to share my findings, so maybe someone else will find the solution faster…
I have a HomeMatic dimmer set up to return to the last dim value whenever it is switched on:
- I hold and press the switch on the wall: The dimmer sets a brightness of, say, 50%.
- I push the switch on the wall: The light turns off.
- I push the switch on the wall again: The light returns to its last dim value, i.e., 50% (as opposed to 100%).
That seemed useful, since the light is really much too bright at its full brightness.
However, now I wanted to automate (toggle) the lights the same way as my switch on the wall does. Unfortunately, Home Assistant would always set the brightness to 100%, when turning the light on. (Which is the default behavior of HomeMatic devices, too. So, all good.) Fortunately, the HomeMatic integration allows to send low-level commands to the devices. So, here is what I set up to make the dimmer return to its last dim level:
- if:
- condition: device
type: is_on
device_id: [redacted]
entity_id: light.wohnzimmer_sofalicht
domain: light
then:
- type: turn_off
device_id: [redacted]
entity_id: light.wohnzimmer_sofalicht
domain: light
else:
- service: homematicip_local.set_device_value
data:
device_id: [redacted]
channel: 1
parameter: OLD_LEVEL
value: true
The key here is to use the set_device_value
service for the datapoint OLD_LEVEL
. I’m using this with the new homematicip_local integration. But I believe the built-in integration has a similar service.
I hope, this helps someone. And if you have a smarter solution to the challenge, let me know!