I have a propritary system called ZenseHome around in the house, all wall lightswitches and outlets are ZenseHome and several ceiling outlets too.
At some point, ZenseHome added MQTT support for their system, so I created this:
Solution 1
eyJleHRTcnZJbnRlZ1R5cGUiOiIiLCJnQ2xpZW50SWQiOiIiLCJjcmVhdG9yTmFtZSI6Ik5vcm1hbm4gUC4gTmllbHNlbiIsIm91dHB1dFR5cGUiOiJibG9jayIsImxhc3RNb2RpZmllck5hbWUiOiJOb3JtYW5uIFAuIE5pZWxzZW4iLCJsYW5ndWFnZSI6ImVuIiwidWlDb25maWciOiJ7fSIsImRpYWdyYW1EaXNwbGF5TmFtZSI6IlNvbHV0aW9uMSIsInNGaWxlSWQiOiIiLCJhdHRJZCI6IjI1MzUyNjE0MSIsImRpYWdyYW1OYW1lIjoiU29sdXRpb24xLmRyYXdpbyIsImFzcGVjdCI6IiIsImxpbmtzIjoiYXV0byIsImNlb05hbWUiOiJTb21ldGhpbmcgYSBiaXQgd2llcmQgZnJvbSBaZW5zZUhvbWUgdG8gUGhpbGlwcyBIdWUiLCJ0YnN0eWxlIjoidG9wIiwiY2FuQ29tbWVudCI6ZmFsc2UsImRpYWdyYW1VcmwiOiIiLCJjc3ZGaWxlVXJsIjoiIiwiYm9yZGVyIjp0cnVlLCJtYXhTY2FsZSI6IjEiLCJvd25pbmdQYWdlSWQiOjIwMzA5NjA3NSwiZWRpdGFibGUiOmZhbHNlLCJjZW9JZCI6MjAzMDk2MDc1LCJwYWdlSWQiOiIiLCJsYm94Ijp0cnVlLCJzZXJ2ZXJDb25maWciOnsiZW1haWxwcmV2aWV3IjoiMSJ9LCJvZHJpdmVJZCI6IiIsInJldmlzaW9uIjoxLCJtYWNyb0lkIjoiZmUwMDI4NTMtYmEyMi00ZDA5LWExNjItZTMyY2E5YWNmZGNlIiwicHJldmlld05hbWUiOiJTb2x1dGlvbjEuZHJhd2lvLnBuZyIsImxpY2Vuc2VTdGF0dXMiOiJPSyIsInNlcnZpY2UiOiIiLCJpc1RlbXBsYXRlIjoiIiwid2lkdGgiOiJudWxsIiwic2ltcGxlVmlld2VyIjpmYWxzZSwibGFzdE1vZGlmaWVkIjoxNzI2MDQ1NzMwNzgyLCJleGNlZWRQYWdlV2lkdGgiOmZhbHNlLCJvQ2xpZW50SWQiOiIifQ==
Pressing the Switch send a signal over 220V cable to the ZenseHome box, that post a message on a MQTT Tpoic, that Home Assistent picks up, and sends a toogle to the Hue Brige, that informs the Lamp over ZigBee..
Worked ok
Solution 2
Later I introduced Node-RED:
eyJleHRTcnZJbnRlZ1R5cGUiOiIiLCJnQ2xpZW50SWQiOiIiLCJjcmVhdG9yTmFtZSI6Ik5vcm1hbm4gUC4gTmllbHNlbiIsIm91dHB1dFR5cGUiOiJibG9jayIsImxhc3RNb2RpZmllck5hbWUiOiJOb3JtYW5uIFAuIE5pZWxzZW4iLCJsYW5ndWFnZSI6ImVuIiwidWlDb25maWciOiJ7fSIsImRpYWdyYW1EaXNwbGF5TmFtZSI6IlNvbHV0aW9uMiIsInNGaWxlSWQiOiIiLCJhdHRJZCI6IjI1MzUyNjEzNSIsImRpYWdyYW1OYW1lIjoiU29sdXRpb24yLmRyYXdpbyIsImFzcGVjdCI6IiIsImxpbmtzIjoiYXV0byIsImNlb05hbWUiOiJTb21ldGhpbmcgYSBiaXQgd2llcmQgZnJvbSBaZW5zZUhvbWUgdG8gUGhpbGlwcyBIdWUiLCJ0YnN0eWxlIjoidG9wIiwiY2FuQ29tbWVudCI6ZmFsc2UsImRpYWdyYW1VcmwiOiIiLCJjc3ZGaWxlVXJsIjoiIiwiYm9yZGVyIjp0cnVlLCJtYXhTY2FsZSI6IjEiLCJvd25pbmdQYWdlSWQiOjIwMzA5NjA3NSwiZWRpdGFibGUiOmZhbHNlLCJjZW9JZCI6MjAzMDk2MDc1LCJwYWdlSWQiOiIiLCJsYm94Ijp0cnVlLCJzZXJ2ZXJDb25maWciOnsiZW1haWxwcmV2aWV3IjoiMSJ9LCJvZHJpdmVJZCI6IiIsInJldmlzaW9uIjoxLCJtYWNyb0lkIjoiYzdjNTllYWItNjE3Yy00ZDhhLWI2ZTAtNTVmZmU2YjNkMzYxIiwicHJldmlld05hbWUiOiJTb2x1dGlvbjIuZHJhd2lvLnBuZyIsImxpY2Vuc2VTdGF0dXMiOiJPSyIsInNlcnZpY2UiOiIiLCJpc1RlbXBsYXRlIjoiIiwid2lkdGgiOiJudWxsIiwic2ltcGxlVmlld2VyIjpmYWxzZSwibGFzdE1vZGlmaWVkIjoxNzI2MDQ1NzMwNTI3LCJleGNlZWRQYWdlV2lkdGgiOmZhbHNlLCJvQ2xpZW50SWQiOiIifQ==
Worked pretty well.
This we started seeing som smaller periods, where the light would not work for some 1 minute... I was thinking that Node-RED or Home Assistant may be hanging due to Ressouces on the Laptop running it.
Solution 3
So I simplified - at this time ZenseHome has introduced Philips Hue support:
eyJleHRTcnZJbnRlZ1R5cGUiOiIiLCJnQ2xpZW50SWQiOiIiLCJjcmVhdG9yTmFtZSI6Ik5vcm1hbm4gUC4gTmllbHNlbiIsIm91dHB1dFR5cGUiOiJibG9jayIsImxhc3RNb2RpZmllck5hbWUiOiJOb3JtYW5uIFAuIE5pZWxzZW4iLCJsYW5ndWFnZSI6ImVuIiwidWlDb25maWciOiJ7fSIsImRpYWdyYW1EaXNwbGF5TmFtZSI6IlNvbHV0aW9uMyIsInNGaWxlSWQiOiIiLCJhdHRJZCI6IjI1MzUyNjEzNyIsImRpYWdyYW1OYW1lIjoiU29sdXRpb24zLmRyYXdpbyIsImFzcGVjdCI6IiIsImxpbmtzIjoiYXV0byIsImNlb05hbWUiOiJTb21ldGhpbmcgYSBiaXQgd2llcmQgZnJvbSBaZW5zZUhvbWUgdG8gUGhpbGlwcyBIdWUiLCJ0YnN0eWxlIjoidG9wIiwiY2FuQ29tbWVudCI6ZmFsc2UsImRpYWdyYW1VcmwiOiIiLCJjc3ZGaWxlVXJsIjoiIiwiYm9yZGVyIjp0cnVlLCJtYXhTY2FsZSI6IjEiLCJvd25pbmdQYWdlSWQiOjIwMzA5NjA3NSwiZWRpdGFibGUiOmZhbHNlLCJjZW9JZCI6MjAzMDk2MDc1LCJwYWdlSWQiOiIiLCJsYm94Ijp0cnVlLCJzZXJ2ZXJDb25maWciOnsiZW1haWxwcmV2aWV3IjoiMSJ9LCJvZHJpdmVJZCI6IiIsInJldmlzaW9uIjoxLCJtYWNyb0lkIjoiZmI4NzczNzEtNzJiNy00ZDQxLWJkZjAtZDA3M2Y2YzVkZTg3IiwicHJldmlld05hbWUiOiJTb2x1dGlvbjMuZHJhd2lvLnBuZyIsImxpY2Vuc2VTdGF0dXMiOiJPSyIsInNlcnZpY2UiOiIiLCJpc1RlbXBsYXRlIjoiIiwid2lkdGgiOiJudWxsIiwic2ltcGxlVmlld2VyIjpmYWxzZSwibGFzdE1vZGlmaWVkIjoxNzI2MDQ1NzMwNTk2LCJleGNlZWRQYWdlV2lkdGgiOmZhbHNlLCJvQ2xpZW50SWQiOiIifQ==
Strangely, this solution did not work very well, besides the hanging times, from pressing a switch until the light toogle took like 1-2 seconds, and on several switches we had to press several times...
So I am back to the solution with Node-RED.
Conclusion
My kind of conclosion is that the Hue interface in the ZenseBox is not working well, but that seems somewhat "farfetched" ...
Some of the "hanging" can for sure be pinpoint to the fact that the ZenseHome switches are + 10 years old - but there stille a significantl improvement using ZenseHome MQTT going aound the Home Assistant (Nore-RED) path.
Another option that I not have tested, i using the Hue palette (Plug in) for Node-RED.