Is there any way from Home Assistant to deactivate a physical switch button, so if someone accidentally turns on the light from the physical switch, it will be ignored?
I know how to send an MQTT package, but what should I have as the topic and payload? Can I assign a fake pin number to a switch on another channel and control it that way?
Well, you can always change Button role to something else (to None or anything) or assign a fake channel on your device. You can also control one device from another device and there are many ways to do it, including:
- sending a HTTP GET to IP with command like POWER ON by using SendGET command
- by using Tasmota Device Groups to group devices
- by using HA automation
It's up to you to choose the method that suits your needs best.
Regarding setting flags from HA, you can use the SetFlag command, see docs:
https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/commands.md The flag number for child lock is 41 and you can set it to on (1) or off (0).
SetFlag command can be send via MQTT or via HTTP, or entered manually, or also even it can be scripted. for example with HttpButton (you can create a custom button on your page that way).
Thanks, is there any way to add this function as a toggle lock or another entity in HA? (like zigbee2mqtt does)
I tried to add it as a relay and addChangeEvent and it works nice.
But it would be nice to instead of having a flag to enable or disable, that the flag creates the new entity to appear or not in Home Assistant, the child lock feature.
I can see how that can be a problem. I will need to think about it. Maybe I can add some simple mechanism for you to publish it. Something like $FLAG41 variable.
Added after 7 [hours] 26 [minutes]:
UPDATE: Working on it, do you know how to use publishInt?
The discussion revolves around the implementation of a "child lock" feature in Home Assistant to disable the physical switch button on devices using OpenBeken firmware, preventing accidental activation of lights. A user inquires about the possibility of deactivating the physical switch through Home Assistant, and responses suggest using MQTT packets to set a flag (Flag 41) for the child lock. Various methods for controlling devices, such as changing button roles, using HTTP commands, and creating custom entities in Home Assistant, are discussed. The conversation also touches on the need for a mechanism to check the state of the flag to determine if the lock is active. Summary generated by the language model.