I’m sorry if the post my appear twice because the first time I’ve deleted it for mistake.
Dear all,
I’m try to configure a smart-plug inside z2m.
Actually I’m able to set the internal relay on-off, and get also enabled the automatic reporting of the rmsVoltage, rmsCurrent and activePower.
Automatic reporting is good because when a fixed time interval expired the smart-plug send in autonomous way the mains quantities (active power, voltage, current), but in a scenario where we may have many smart-plug installed I think that this can be a trouble because I will have a lot of messages to my coordinator so may be the network will get congestioned (about this point please let me also know your thinking , thank!).
A first solution may be slow down the rate of the attribute reporting that actually seems to me about every 1 second, someone know if this is configurable inside the devices.js file and how this can be accomplished?
Another option may be directly query the smart-plug from my zigbee2mqtt when I need to know some parameter, but to perform this task I think that I have to code somethings in order to get the system able to send specifical command to the smart-plug, someone more skilled with the zigbee2mqtt envionment have some guidance about this point?
Another option may be directly query the smart-plug from my zigbee2mqtt when I need to know some parameter, but to perform this task I think that I have to code a custom adapter in order to get the system able to send a specifical command to the smart-plug, someone more skilled with the zigbee2mqtt environment have some guidance/note concerning this point?
Analyzing the code reported in the devices.js file, for the various smart-plugs, I do not seem to have seen implementations related to the toZigbee array relating to the transmission of specific commands for reading specific parameters about the smart-plug so seems to me that I’ve to code a custom function able to manage these one, but I’m at the beginning with zigbee2mqtt.
As first step I’ve searched for some custom command on the toZigbee array, I think that by using the key: attribute inside the converters array is possible define my command, so a thing like this one:
key: [‘readActivePower’,‘readACCurrent’],
ad so on… I’m right?
In order to send the specific command I think to have to use the await entity.write() function, someone know if there is a API description/manual/note for the implementation details?
Thank!
EDIT: looking through the code I’ve see a note inside the toZigbee.js file:
// Entity is expected to be either a zigbee-herdsman group or endpoint
// Meta is expect to contain:
// {
// message: the full message, used for e.g. {brightness; transition;}
// options: {disableFeedback: skip waiting for feedback, e.g. Hampton Bay 99432 doesn’t respond}
// endpoint_name: name of the endpoint, used for e.g. livolo where left and right is
// seperated by transition time instead of separte endpoint
// }
so I’m looking inside the.read API link to read an attribute, is the correct place?