I'm changing a smart socket from Wi-Fi to Zigbee in a smart home
I recently decided to change the smart socket, it was Wi-Fi, but I wanted to install a socket using the Zigbee protocol, in principle, it is less reliable because Wi-Fi is mainly used in the cloud, it is unlikely to flash it and it is not flashed, and of course cloud management is not very reliable, sockets Zigbee, of course, they all work locally, in this case I use a stick that is connected directly to the smart home server, so in principle all my solutions are completely local, the advantage of using a Zigbee outlet is that, that it is constantly connected to the network and Zigbee network, it acts as a router, which significantly expands the network and makes it more reliable, that is, different sensors that are mainly powered by batteries also get much better, they have a stronger signal, and they basically drain less battery, which is also very convenient.
But the change itself, of course, causes a lot of problems, it's not easy to plug in another outlet and everything will work automatically, I have this particular outlet used to control the kettle, it can just turn on this kettle, turn it off if necessary remotely, and also measure the consumption of the kettle and then I use it, including for voice notification that the kettle has already boiled the water, it's convenient, in principle, I'm already very used to it, but I decided to change this outlet just because it's cloudy and there are always some delays with it.
Since this is still a different outlet, it is identified with a different identifier in the smart home system, and of course I have to re-register the outlet in all scenarios and re-add it in all smart home systems that I use, plus there is also a problem that this outlet, Wi-Fi, uses the same parameters. which it transmits and their name is even different, but the Zigbee sockets have different parameters, and they are not compatible with each other, you have to constantly rewrite this too if the script used some parameter and it has a different name, even in this case, you will have to change it, but for example, in some Home Assistant system, I also have it added there, that is, it is automatically added to almost all systems, when it appears, this outlet, in the Home Assistant, it also has a different identifier for each parameter, it also changes accordingly. Of course, you can rename everything, but you either have to do it from the beginning, then come up with a naming system for all devices and instead of the main essentially symbolic name in the 16-bit system, use some kind of specially designed naming system, and then if it was provided in advance, then of course there will be fewer changes, but if it was not provided, you will have to re-search for all the scenarios in which it is used, for example, some of my scripts are also being processed in NodeRed, that is, you also have to change the script there and, accordingly, everything The parameters that were used in NodeRed to run scripts should also be renamed and manually reconfigured again, this is certainly not very convenient, and it takes a very long time.
Also, this outlet still works with some problems, that is, it has some kind of error in the definition of energy consumption, most likely, there are even complaints in various forums that even if the outlet actually consumes electricity, well, not the outlet, but the device connected to it, it can send everything consumption is 0, that is, the power consumed and the current can also be 0, and of course this needs to be filtered out in order to be used in the scenario, and there is also a problem with this, I had to rewrite all the rules because, for example, there were no such errors with the Wi-Fi outlet, that is, it still worked more correctly, but the Wi-Fi outlet had another problem that it sent information that consumption was taking place with a long delay of about 30 seconds, Zigbee does it. more often, it reacts much faster to changes in consumption, but apparently because of this, such an error is obtained related to the transfer of parameters, I also had to write in the notification scripts, respectively, that the rules themselves that are associated with the notification are scripts that I use, written in bash, which check the change in these values, that is, in this case, the power consumption and if the power consumption stopped after a while, it was consumed for 30 seconds, and then stopped, then this is just an event to inform that the kettle has boiled and then this information is sent to the gateway from Xiaomi. it's flashed, Linux is also there, and in principle, you can do various voice messages directly through the API interaction format with this gateway, it's convenient, in principle, it sounds very good, but due to the fact that the outlet also changed the ID, I had to redo it.
But I originally had it so stipulated that any device has an internal identifier in the system, it's a six-digit number, but again I made it so that I still tried to take into account different parameters in this identifier, that is, for example, which manufacturer, which exchange format, that is, my Wi-Fi has a certain number. in this number, but Zigbee has a different number, and because of this, I had to change the identifier anyway, which of course caused me great difficulties, I basically just wanted to avoid this, but in the future, it will probably be necessary to make identifiers related not to the system or the exchange format, or the types of device, or the type of parameter, but still to what I use this device for.
For example, I made it in the hallway that I have a switch, it also has an identifier that is associated with the manufacturer of this switch, but I also use an identifier directly related to the location of this switch, that is, it is located in the hallway, and that it controls the light, that is, it is more universally obtained. in one place, I will need, if necessary, if I suddenly want to change from Wi-Fi to Zigbee, for example, then I will have to redo less.
But in fact, of course, this is done differently in different systems, for example, in OpenHAB I use the same naming system in Home Assistant, I did not use an alternative naming system at all, that is, there is actually just the factory number of the devices and of course I have to rewrite everything, well, now I also use some naming system in Home Assistant, for example, there is a hallway outlet, or a kitchen kettle outlet, that is, in principle, it can also be used more universally later, but in any case in order to, to do this, it's better, of course, to create separate virtual parameters, virtual devices, and manage everything through them, but then it becomes more difficult, you will need to have separate scripts that will update this data in virtual devices, and I also had this outlet inserted into the Yandex ecosystem of the smart home, and you could remotely say turn on the kettle and, accordingly, it turned on, this outlet turned on, but you still had to press the button on the kettle in advance in order for it to turn on, but if, for example, I want to turn it off, then I can also tell you to turn off the kettle, in principle, this outlet can also turn off.
In order to manage it this way, Yandex has the opportunity to use several options in the device names, I additionally just write that, say, socket 3, but indicate that there is also a separate name, for example, a kettle, then the socket will work either by its name socket 3 in commands, or just speak like a kettle, and so it will be. it works, but since Yandex still works with a local identifier, and my Wi-Fi was generally linked through the Tuya system, that is, it wasn't even connected through the smart home system, and of course I had to recreate new devices after that, update it again, this device appeared in the Yandex smart home, and I had to give all the names there again, and the old one had to be deleted, respectively, because I had already decided on this Wi-Fi outlet. use it for other scenarios.
I want to connect it to the smart home server so that I can reboot it via Wi-Fi via a separate application from Tuya if it freezes and it is required.
Automation in a smart home should be useful and create additional comfort, but sometimes everything goes wrong… The reasons for this, and how to configure everything, see on my channel.