Requesting the battery level of a remote node using the gateway's serial API



  • I can't seem to find any way to request the battery level of a remote node from the controller using the serial API. The I_BATTERY_LEVEL internal message seems to be ignored by the remote node, so it looks like it's a one-way message (node to gateway).

    The remote node does seem to publish its battery level every couple of minutes. I just can't request it from the controller at will. I'm using the MockMySensors sketch while testing, if it helps.

    Is there a way to get the battery level of a remote node from the controller? If not, should I file a bug to put this into the todo? It looks like this shouldn't require any API change to implement.


  • Admin

    Request of I_BATTERY_LEVEL is currently not supported (none of the internal commands is passed to the sketch receive-function).

    But you could do a little hack by implementing receive() {} and call sendBatteryLevel (...) when you receive a command of your choice.


Log in to reply
 

Looks like your connection to MySensors Forum was lost, please wait while we try to reconnect.