Hi, My MySensors Door/Window sensors (http://www.domoticz.com/forum/viewtopic ... 42&t=18484) send battery status once a day, but this is not reflected in Domoticz. I see the message arrive at the MySensors gateway,
Jul 30 08:50:28 RPiGW mysgw: TSF:MSG:READ,1-1-0,s=255,c=3,t=0,pt=1,l=1,sg=0:99
But it 'only get's updated in Domoticz when a door/window is opened and closed. Especially for window sensors this can become problematic. Because I use LiPo cells, i want to know the battery status before they are discharged to low.
Is it possible to implement this?
regards, Harry
MySensors battery updates
Moderators: leecollings, remb0
Re: MySensors battery updates
Hmm, thought as a workaround to send the door/window state also to force a battery update
Jul 30 11:23:15 RPiGW mysgw: TSF:MSG:READ,1-1-0,s=255,c=3,t=0,pt=1,l=1,sg=0:99
Jul 30 11:23:15 RPiGW mysgw: TSF:MSG:READ,1-1-0,s=0,c=1,t=16,pt=2,l=2,sg=0:0
But if the door/window switch value is the same as the previous, it won't update the door/window switch status and battery status either.
Jul 30 11:23:15 RPiGW mysgw: TSF:MSG:READ,1-1-0,s=255,c=3,t=0,pt=1,l=1,sg=0:99
Jul 30 11:23:15 RPiGW mysgw: TSF:MSG:READ,1-1-0,s=0,c=1,t=16,pt=2,l=2,sg=0:0
But if the door/window switch value is the same as the previous, it won't update the door/window switch status and battery status either.
- gizmocuz
- Posts: 2552
- Joined: Thursday 11 July 2013 18:59
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: Top of the world
- Contact:
Re: MySensors battery updates
How do you send a single battery level update via mysensors ?
Quality outlives Quantity!
Re: MySensors battery updates
2.2.0-beta (because run on RPI + RFM69)gizmocuz wrote:How do you send a single battery level update via mysensors ?
float p = vcc.Read_Perc(VccMin, VccMax);
sendBatteryLevel((uint8_t)p);
- gizmocuz
- Posts: 2552
- Joined: Thursday 11 July 2013 18:59
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: Top of the world
- Contact:
Re: MySensors battery updates
Looking in the code, we update the nodes battery level, and it will be updated when we receive a new sensor value.
For switches it is indeed when there is a change switch (but forced for V_TRIPPED and V_SCENE (on/off)
MySensorsBase::UpdateSwitch
Here it is where it's checked.. maybe this peace of code should be removed for mysensors ?
But be carefull when you have a script on an 'On' command.. because this WILL be triggered...
Maybe you can test with it ? Also interested to know opinions from other users
For switches it is indeed when there is a change switch (but forced for V_TRIPPED and V_SCENE (on/off)
MySensorsBase::UpdateSwitch
Here it is where it's checked.. maybe this peace of code should be removed for mysensors ?
But be carefull when you have a script on an 'On' command.. because this WILL be triggered...
Maybe you can test with it ? Also interested to know opinions from other users
Quality outlives Quantity!
Re: MySensors battery updates
I will give it a try in my test setup, but I'm not that experienced with C++gizmocuz wrote:Maybe you can test with it ? Also interested to know opinions from other users
Have to wait a while for some new hardware to make a test node, all others are in production
Re: MySensors battery updates
Should MySensorsBase::UpdateNodeBatteryLevel not be used for battery updates? If I send single battery updates using sendBatteryLevel((uint8_t)p); i can see them come in here? There is a peace of code there that is commented out ( //Uncomment the below to for a sensor update ). but if I comment it out nothing happens.
Re: MySensors battery updates
MySensor uses V_TRIPPED MyMessage msgContact(CONTACT_CHILD_ID, V_TRIPPED); , but there is no forced update.gizmocuz wrote:For switches it is indeed when there is a change switch (but forced for V_TRIPPED and V_SCENE (on/off)
Who is online
Users browsing this forum: No registered users and 1 guest