Hello everyone,
I’m trying to read the status of my bedside lamp to trigger a ‘good night’ status in HA.
Since the Xiaomi Bedside lamp 2 doesn’t allow lan control anymore, i do it like this:
- platform: command_line
name: Yeelight Power
command: "miiocli yeelight --ip 10.0.1.172 --token 4556445544545455454 status | grep 'Power' | awk '{print $2}'"
scan_interval: 60 # Set the desired update interval in seconds
- platform: template
sensors:
yeelight_on_off:
friendly_name: "Yeelight On/Off"
value_template: "{{ is_state('sensor.yeelight_power', 'true') or is_state('sensor.yeelight_power', 'True') }}"
Even though the command is giving me a “True” it doesn’t seen to trigger the yeelight_on_off