Page 2 of 2
Re: sendHeartbeat() ?
Posted: Tuesday 16 February 2016 17:37
by Lemme
Yeps!
EDIT: (that was ment for sundberg84, before I saw that you answered him...)
Re: sendHeartbeat() ?
Posted: Wednesday 17 February 2016 9:00
by sundberg84
Great, yea - I have already implemented it in my nodes - all i need is to update Domoticz
Thanks and great work!
Re: sendHeartbeat() ?
Posted: Tuesday 23 February 2016 18:58
by niceandeasy
gizmocuz wrote:Thanks for the feedback!!
Next update also supports blinds and RGB/RGBW
Will this apply to the dummy RGB/RGBW sensor, too? I'd love to be able to use the color picker and use the color value in LUA.
Re: sendHeartbeat() ?
Posted: Tuesday 23 February 2016 19:39
by gizmocuz
No this is for mysensors, and the above is already done
Re: sendHeartbeat() ?
Posted: Tuesday 23 February 2016 21:20
by niceandeasy
gizmocuz wrote:No this is for mysensors, and the above is already done
If this refers to the RGB Dummy sensor's colorpicker color-information being usable in LUA, then I could use some help on how to do that.
I have been checking what values are available from a dummy RGB sensor after every new beta release, by querying it by JSON. I couldn't find anything that resembles color info, so I assumed, it's not available in LUA, yet.
All clues are very much appreciated.
Thanks.
EDIT: I'm off-topic, here. I posted my findings here:
viewtopic.php?f=6&t=10458. Please take a look. It's still not available.
Re: sendHeartbeat() ?
Posted: Saturday 26 March 2016 13:56
by franzelare
anyone tried to use the hartbeat the other way around?
I see that I loose communication sometimes with LAN or WiFi gateways and have to restart the node to be able to connect again.
so i would like the node to reboot by itself when it doesn't get a ping from domoticz for x minutes
Re: sendHeartbeat() ?
Posted: Saturday 26 March 2016 22:36
by franzelare
gizmocuz wrote:Domoticz already sends heartbeat messages to the controller to check if it is still alive
How can I detect the heartbeat send by domoticz in the mysensor node?
I like to see if the heartbeat is received and otherwise reboot the node
Re: sendHeartbeat() ?
Posted: Tuesday 17 January 2017 0:18
by Jan80
I am using the sendHeartbeat() funtion with an ESP8266 node. The node has only actuators and no sensors. I need the heart beat to prevent Domoticz from resetting the connection due to data timeout. I have set the data timeout to 1 minute. This way Domoticz reconnects quickly when I restart the node. In this scenario Domoticz seems to ignore the heart beat. Is this because it is coming from a gatway node with node id 0? Domoticz version is 3.5837. The node's MySensors version is 2.1.0.
Re: sendHeartbeat() ?
Posted: Tuesday 17 January 2017 9:23
by franzelare
I solved the issue bij adding a childID 100 to every node and use that to ping pong a heartbeat myself
I have a lua time script in domoticz that switches on the heartbeat and added the following to the mysensor node:
to prepare:
Code: Select all
//heartbeat timer
#include <SimpleTimer.h>
SimpleTimer timerheartbeat;
// define heartbeat variables
#define CHILD_ID_HEART 100
int heartbeatcount = 0;
MyMessage msgHeart(CHILD_ID_HEART,V_TRIPPED);
in the setup:
Code: Select all
// Present heartbeat signal
present(CHILD_ID_HEART, S_DOOR, "Heart Beat");
// setup measurement timer interval
timerheartbeat.setInterval(360000, checkReboot); // 6 minutes in miliseconds
in the loop
and 2 voids
Code: Select all
void checkReboot() {
if (heartbeatcount <= 4 ){
send(msgHeart.set(0));
ESP.restart();
}
else {
heartbeatcount = 0;
send(msgHeart.set(0));
}
}
Code: Select all
void receive(const MyMessage &message) {
//check if the message is heartbeat
if (message.type==V_LIGHT and message.sensor==CHILD_ID_HEART) {
// Read message
send(msgHeart.set(0));
heartbeatcount = heartbeatcount+1;
}
}
only issue with the ESP unit is that the soft reboot is not always working
so I added a hard reset to pin 16 the setup
- ESP8266 reboot.jpg (45.42 KiB) Viewed 3914 times
Re: sendHeartbeat() ?
Posted: Tuesday 17 January 2017 10:07
by Jan80
Because I am writing a new firmware for a commercial device (Sonoff Touch) adding parts to the circuit is not an option. But at least you confirmed, that MySensors's sendHeartbeat() function does not work with an gateway device. I hope the devs will have a look at that.
In the meantime I will try to use the sendBatteryLevel() function. This wont add additional devices.
Re: sendHeartbeat() ?
Posted: Tuesday 17 January 2017 15:52
by franzelare
if you only want to have domoticz know that the unit is still alive you can also just run a simple timer that is sending an toggle switch every 25 seconds so you know you re-establish the connection when you miss 2 heartbeats
Re: sendHeartbeat() ?
Posted: Wednesday 18 January 2017 11:41
by franzelare
if you are looking into the unit being alive... have a look at the ESP units you are using first!!!
I use ESP201 units from
https://hackerstore.nl/ these loose the connection about 4 times a day, some units even worse :$ even with a separate accesspoint only 7 meters away (with 1 glass window and a single brick wall in between) on a quite chanel. adding a old antenna from an accesspoint only made this worse. I have 3 of these units runing but will take them down later this year and replace them with an other solution.
I use ESP12E units (from the same web store), these might loose the connection once a week or so, even with concreet walls with loads of metal wiring inside in between... i have 5 of these at home now (4 curtains and 1 IR remote) and they hardly give me any trouble.
I have ESP12 units from adafruite, here you might be lucky or your not... but don't assume you are using these for the project.
already had to return 2 of them because they died on me or were DOA
Re: sendHeartbeat() ?
Posted: Sunday 19 February 2017 17:38
by manutremo
Many thanks for adding this functionality, I'm very interested on this feature. I've tried with both functions sendHeartbeat() and smartSleep() (which sends a heartbeat before putting the node to sleep), and I don't see the last seen timestamp being updated unless some sensor value is also sent previously. I can see the heartbeat being sent correctly in my com output window. I'm running last beta 3.6708. Any idea of why the last seen timestamp doesn't seem like it is being updated?
Re: sendHeartbeat() ?
Posted: Wednesday 08 March 2017 8:32
by BluesBro
Can this feature be extended to, lets say, ESPeasy? Like a JSON command?
Re: sendHeartbeat() ?
Posted: Friday 15 September 2017 13:17
by yfands
Version: 3.8394
Build Hash: e9d01f6
Compile Date: 2017-09-13 08:54:08
Platform Raspberry Pi.
Hello,
Hereby I would very much like to address the heartbeat function from mysensors again.
As stated in the following link:
https://github.com/domoticz/domoticz/issues/1396 according to gizmocuz its not that easy to implement the heartbeat option, some types are implemented. I checked the latest build files and there is no change in the number of handled types. Hereby I would like to plea for an implementation of the Mysensors V_Value option. In my latest project I used a lightning detector. Who will of course only transmit when there is lightning. In between I like to know if my device is still alive, and don't have to climb every day to the attic to monitor the battery live
, so I send a heartbeat with mysensors, unfortunately Domoticz doesn't handle V_Value heartbeats.
Dear Domoticz team, can you please consider my request, I'm sure there are other builders who can appreciate the implementation.
Thanks for listening
Regards
Frank