I have a few rooms that have an Inovelli Blue switch with a Big A** Fan. Because the Big A** Fan is not Zigbee, I can’t rely on binding.
The Inovelli Blue switch light.room_switch
exposes a brightness
attribute, and also, the Big A** Fan’s light module light.fan_light
exposes a brightness
attribute.
One-way syncing would be easy enough, but the fan also has an IR remote which I can use to adjust its brightness.
So, overall, what I want is an easy way to tell Home Assistant, “Keep the brightness of these two entities synced. If the switch brightness updates, then update the fan brightness. If the fan brightness updates, then update the switch brightness.”
I’ve tried various blueprints to try and achieve this and they are all pretty clumsy. I’ve even tried to make my own automation, and it’s not perfect either.
My attempt:
alias: Office Light Test
description: ""
triggers:
- trigger: state
entity_id:
- light.office_switch
attribute: brightness
id: switch
- trigger: state
entity_id:
- light.fan_light
id: fan
conditions:
- condition: state
entity_id: input_boolean.sync_lock
state: "off"
actions:
- choose:
- conditions:
- condition: trigger
id:
- switch
sequence:
- sequence:
- action: input_boolean.turn_on
metadata: {}
data: {}
target:
entity_id: input_boolean.sync_lock
- action: light.turn_on
metadata: {}
data:
brightness: >-
{{ state_attr('light.office_switch', 'brightness') if
state_attr('light.office_switch', 'brightness') is
not none else 0 | int }}
target:
device_id: 80d01acc2e8797bd69915c442d4cf682
- conditions:
- condition: trigger
id:
- fan
sequence:
- sequence:
- action: input_boolean.turn_on
metadata: {}
data: {}
target:
entity_id: input_boolean.sync_lock
- action: light.turn_on
metadata: {}
data:
brightness: >-
{{ state_attr('light.fan_light', 'brightness') if
state_attr('light.fan_light', 'brightness') is not
none else 0 | int }}
target:
device_id: 40ac60861a4e345b16b7970ed8d29c07
- delay:
hours: 0
minutes: 0
seconds: 1
milliseconds: 0
enabled: true
- action: input_boolean.turn_off
metadata: {}
data: {}
target:
entity_id: input_boolean.sync_lock
mode: parallel
Sometimes the sync_lock get’s in a weird state if we have a power flicker or something and I accidentally press the wall switch while some comms are down. The whole idea behind the sync lock is to prevent a looping condition whereby Home Assistant sees the fan light brightness change, so it updates the switch brightness, but then it sees the switch brightness change, so it updates the fan brightness, and so on.