I have a Wiz light configured in HA using the “wiz_light” integration. I can turn it on/off and set the brightness using the standard “Light” card in Lovelace so that confirms I have the Integration setup correctly.
What I’m trying to setup is the ability to use an IR remote to toggle the light on/off and be able to set the brightness level. I have an ESP01 with an IR receiver and have it configured to capture IR codes to trigger different actions.
So far it can successfully toggle the light on/off using the following:
binary_sensor:
- platform: remote_receiver
name: "Fan Lights"
on_release:
homeassistant.service:
service: light.toggle
data:
entity_id: light.livingroom_fanlight_1
filters:
- delayed_off: 100ms
pioneer:
rc_code_1: 0x0045
What I can’t figure out is how to set the brightness. I’d like to use 2 different buttons on the remote to increase/decrease the brightness by 5% steps per button press. I know the ‘Light’ integration has a ‘brightness’ property that can be used to set the brightness, but to inc/dec the current level by 5 I would first need to know what the current level is and that’s where I’m stuck.
How do I get the current brightness value and how then would I add/subtract 5 and send that as the new level?
Thanks
Ed