sendHeartbeat() ?

Moderator: leecollings

sundberg84
Posts: 52
Joined: Sunday 17 May 2015 11:20
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Sweden
Contact:

sendHeartbeat() ?

Post by sundberg84 »

Hi!

"sendHeartbeat() - Allows node to send heartbeat and controller to ping nodes." (From 1.6beta)
Does this work in Domoticz or is it something we can implement?

It would be great if this heartbeat updated the timestamp so the node doesnt go red.

I see there is something in the code:

Code: Select all

case I_HEARTBEAT:
			//Received a heartbeat
			while (1 == 0);
			break;
But in not that good so i can do anything about it...
Controller: Domoticz (Raspberry PI)
Gateways: MySensors (Ethernet W5100), RFLink
User avatar
gizmocuz
Posts: 2352
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: sendHeartbeat() ?

Post by gizmocuz »

Domoticz already sends heartbeat messages to the controller to check if it is still alive
Quality outlives Quantity!
sundberg84
Posts: 52
Joined: Sunday 17 May 2015 11:20
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Sweden
Contact:

Re: sendHeartbeat() ?

Post by sundberg84 »

This is not controller heartbeat.
This is from the nodes sending a heartbeat to let the controller know its alive.
(and controller to Ping nodes)

As I said it would be great if this heartbeat could update "last seen timestamp" or something like that...
Controller: Domoticz (Raspberry PI)
Gateways: MySensors (Ethernet W5100), RFLink
User avatar
gizmocuz
Posts: 2352
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: sendHeartbeat() ?

Post by gizmocuz »

that should be done between the gateway and the node
the last-seen is updated when a new value is send
Quality outlives Quantity!
sundberg84
Posts: 52
Joined: Sunday 17 May 2015 11:20
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Sweden
Contact:

Re: sendHeartbeat() ?

Post by sundberg84 »

Hi!

Yes, and this hearbeat is done between the node and gateway, but its not a new value... thats the thing.
Sometimes, some nodes doesnt update the value for along time and then the node goes red in Domoticz.
sendHeartbeat() is a ping to let the controller know its alive even if its not a new value.
Controller: Domoticz (Raspberry PI)
Gateways: MySensors (Ethernet W5100), RFLink
sundberg84
Posts: 52
Joined: Sunday 17 May 2015 11:20
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Sweden
Contact:

Re: sendHeartbeat() ?

Post by sundberg84 »

I guess the question is: is it possible to update "last seen" without updating the value?
Controller: Domoticz (Raspberry PI)
Gateways: MySensors (Ethernet W5100), RFLink
malarcy
Posts: 50
Joined: Sunday 15 November 2015 13:36
Target OS: Linux
Domoticz version:
Contact:

Re: sendHeartbeat() ?

Post by malarcy »

I'd like to add my request to this (I already have a feature request in tracker for the ability to update a switch even if the new value is the same as the old).

I want to do this to implement a heartbeat for a sensor that changes infrequently but my solution is less elegant that surfacing the sendHeartbeat() all the way to domoticz.

We have other "internal" transport and environment paramaters surfaced in domoticz for various hardware types (battery level and rf stength) - so enabling heartbeat seems to match this type of data,

I vote/+1/ask for sendHeartbeat to be reflected in the last seen status of a sensor - at the moment the implementation is last updated, not last seen -at least for mysensors.
Lemme
Posts: 45
Joined: Sunday 31 January 2016 13:50
Target OS: Windows
Domoticz version: Dev
Location: DK
Contact:

Re: sendHeartbeat() ?

Post by Lemme »

Hi
I must back this 100% up - vote/+1. This feature is especially important for security sensors.
In my use case I am going to mount security sensors at the windows. Some of these windows are rarely opend, only mabye 2-4 times per year. But if a thief would enter, I need theese sensors to work.

Having the node send a 'hartbeat' to the controller to update the "last seen" would make me confident that the security system works. Without having to go around the house to activate the sensors manually every few days. Having the possibility for the node to send a 'hartbeat' to Domoticz for example every 24 hours would work.

Hope this clarifies why this feature is important. It is not about the node sending a hartbeat the the gateway, it's about letting Domoticz aware that the node is still present, but have not yet transmittet anything.
User avatar
gizmocuz
Posts: 2352
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: sendHeartbeat() ?

Post by gizmocuz »

We are talking about a feature that is currently only in the development branch 1.6 (2.0)

I guess this is only for lights/switches (and those kinds of sensors) and not for temperature kind of sensors (as you just update these of course... and at least once an hour (~5 minutes recommended)

There is also a I_HEARTBEAT_RESPONSE message now, but there is not much documentation...
Quality outlives Quantity!
Lemme
Posts: 45
Joined: Sunday 31 January 2016 13:50
Target OS: Windows
Domoticz version: Dev
Location: DK
Contact:

Re: sendHeartbeat() ?

Post by Lemme »

Yes - this is currently only for the development branch 1.6. But this important feature will be released in production soon.
And you are quite right about the use. This is primarily for switches and like. Not temp.sensors or others that are intended to transmit regulary.
I do not know about the I_HEARTBEAT_RESPONSE part. Mabye someone else can elaborate a littele bit about that part?
User avatar
gizmocuz
Posts: 2352
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: sendHeartbeat() ?

Post by gizmocuz »

1.6 is in development for quite some time now, and it just got labelled 2.0
Not sure how fast this will be.

So to test this, i need to make a test sketch and just call the sendHeatbeat function ?
I wonder what I_HEARTBEAT_RESPONSE does, maybe the controller should send an acknowledgement back to the node ?
Quality outlives Quantity!
User avatar
gizmocuz
Posts: 2352
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: sendHeartbeat() ?

Post by gizmocuz »

Seems we need to work with I_HEARTBEAT_RESPONSE, as the sendHeartBeat sends a I_HEARTBEAT_RESPONSE to the controller
Quality outlives Quantity!
User avatar
gizmocuz
Posts: 2352
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: sendHeartbeat() ?

Post by gizmocuz »

Please try beta #4578, this should work now for normal lights/switches (not including at the moment RGB/RGBW and blind sensors)
Quality outlives Quantity!
Lemme
Posts: 45
Joined: Sunday 31 January 2016 13:50
Target OS: Windows
Domoticz version: Dev
Location: DK
Contact:

Re: sendHeartbeat() ?

Post by Lemme »

Wow - you are a fast mover!
I will make a new setup and try it out.
Lemme
Posts: 45
Joined: Sunday 31 January 2016 13:50
Target OS: Windows
Domoticz version: Dev
Location: DK
Contact:

Re: sendHeartbeat() ?

Post by Lemme »

Hi again
I did a fresh v2 install of the MySensors library on the GW+Node, and the updated #4582 Domoticz.
And I can confirm that it works perfectely. This is great news!

Many thanks!
User avatar
gizmocuz
Posts: 2352
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: sendHeartbeat() ?

Post by gizmocuz »

Thanks for the feedback!!
Next update also supports blinds and RGB/RGBW
Quality outlives Quantity!
Derik
Posts: 1601
Joined: Friday 18 October 2013 23:33
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Arnhem/Nijmegen Nederland
Contact:

Re: sendHeartbeat() ?

Post by Derik »

And what are the new options with this feature......
Xu4: Beta Extreme antenna RFXcomE,WU Fi Ping ip P1 Gen5 PVOutput Harmony HUE SolarmanPv OTG Winddelen Alive ESP Buienradar MySensors WOL Winddelen counting RPi: Beta SMAspot RFlinkTest Domoticz ...Different backups
User avatar
gizmocuz
Posts: 2352
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: sendHeartbeat() ?

Post by gizmocuz »

Derik wrote:And what are the new options with this feature......
Basically none.... but...

Imagine you have a security device made with mysensors (like a smoke detector)
you can use the heartbeat function in your sketch to send each 10 seconds a heartbeat
this will update the last seen date/time in domoticz, so you know that this smoke detector is still online and working !

it will not send a "Off" or "On" so your scripts wont be triggered, it only updates the last seen date/time
Quality outlives Quantity!
sundberg84
Posts: 52
Joined: Sunday 17 May 2015 11:20
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Sweden
Contact:

Re: sendHeartbeat() ?

Post by sundberg84 »

Great news - all i have to do is to call sendHeartBeat() from the node and this will update the node?
Controller: Domoticz (Raspberry PI)
Gateways: MySensors (Ethernet W5100), RFLink
User avatar
gizmocuz
Posts: 2352
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: sendHeartbeat() ?

Post by gizmocuz »

sundberg84 wrote:Great news - all i have to do is to call sendHeartBeat() from the node and this will update the node?
it should update the last update status in domoticz
and you have to run the latest mysensors development branch code in the node and gateway
Quality outlives Quantity!
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest