Hi All
I’ve gotten my magic mirror sensor working, and I’ve constructed a switch that uses the sensor for status.
But the status is not update that fast, so the switch acts a bit funky.
Switch off: status shown as off
Turn on switch: status shown as on
status reverts to off
after a while the sensor is updated, and status shows on
So it’s definetely because the sensor isn’t updated as fast, but is there a way to fix it?
It doesn’t matter if there is sent multiple 'on’s or 'off’s, so it’s not a technical problem, but rather an aesthetic.
The sensor looks like this:
- platform: rest
name: MagicMirror_Bathroom
resource: http://MM_IP:8080/api/monitor/status
value_template: '{{ value_json.monitor == "unknown" }}'
The services looks like this:
rest_command:
turn_off_mm_screen:
url: http://MM_IP:8080/api/monitor/off
turn_on_mm_screen:
url: http://MM_IP:8080/api/monitor/on
dim_mm_screen:
url: http://MM_IP:8080/api/brightness/75
undim_mm_screen:
url: http://MM_IP:8080/api/brightness/100
The switch looks like this:
- platform: template
switches:
magicmirror_bathroom:
value_template: "{{ is_state('binary_sensor.magicmirror_bathroom', 'on') }}"
turn_on:
service: rest_command.turn_on_mm_screen
turn_off:
service: rest_command.turn_off_mm_screen
This works, except for the wobling of the status showing, so is there a way I can make the status update faster, or make the switch a bit slower in reverting?