So, I have a TRADFRI bulb, TRADFRI on/off switch, both joined to my zigbee2mqtt network and discovered in HA. I also have a Sonoff mini running tasmota. I want to
-
Be able to use the “primary function” (on off) of the light without any smarthome (in case of server down or HA install broken)
-
Not getting blinded by the light when power is back after a power outage
-
Use the dimmer function
What I did :
-
Set the bulb
power_on_behavior
toON
-
PowerRetain 1
on Tasmota
This will take care of the power outages and manual control of the light (Sonoff Mini has mechanical switch connection headers)
Created 5 automations with TRADFRI on/off:
-
ON action → turns sonoff mini on
-
OFF action → turns sonoff mini off
-
Move brightness up action → send mqtt
{"brightness_move": 40}
-
Move brightness down action → send mqtt
{"brightness_move": -40}
-
Stop brightness action → send mqtt
{"brightness_move": 0}
Is that the cleanest way to achieve this ? I think 5 automations is pretty “heavy” but could not think of a cleaner way.
Also, what would be the solution to the following problem : HA is down, my light turns on thanks to the Sonoff mini but the brightness is set to 1% (last state before shutdown) ?