<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Heartbeat]]></title><description><![CDATA[<p dir="auto">hello<br />
Has it there in the library means to control whether a node is active?<br />
type heartbeat<br />
thanks</p>
]]></description><link>https://forum.mysensors.org/topic/609/heartbeat</link><generator>RSS for Node</generator><lastBuildDate>Mon, 15 Jun 2026 10:56:33 GMT</lastBuildDate><atom:link href="https://forum.mysensors.org/topic/609.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 16 Nov 2014 10:47:11 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Heartbeat on Wed, 19 Nov 2014 09:50:28 GMT]]></title><description><![CDATA[<p dir="auto">thank you for your answer</p>
]]></description><link>https://forum.mysensors.org/post/6880</link><guid isPermaLink="true">https://forum.mysensors.org/post/6880</guid><dc:creator><![CDATA[filoucaenais]]></dc:creator><pubDate>Wed, 19 Nov 2014 09:50:28 GMT</pubDate></item><item><title><![CDATA[Reply to Heartbeat on Sun, 16 Nov 2014 15:05:22 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/filoucaenais" aria-label="Profile: filoucaenais">@<bdi>filoucaenais</bdi></a></p>
<p dir="auto">I do it by sending the status with a regular interval... so that you can see from the Last Update time in the device panel (Vera).</p>
<p dir="auto">like this example:</p>
<pre><code>/*
* Motion Sensor Version 1.1
*
* November 7, 2014
* -Added pushing text status to V_VAR1
*
* Version 1 - October 4, 2014
* -Modified to transmit on state change
* -removed Sleep for mains-only device
* -Updates gateway according to UPDATE_INTERVAL
*
*/
#include &lt;MySensor.h&gt;
#include &lt;SPI.h&gt;
//
#define DEBUG
//
#define DIGITAL_INPUT_SENSOR 3
#define RADIO_ID 2
#define CHILD_ID 1
#define UPDATE_INTERVAL 60000UL  // 1 minute
//
boolean lastSensorState;

//
MySensor gw;
//
MyMessage stateMsg(CHILD_ID, V_TRIPPED);
MyMessage updateMsg(CHILD_ID, V_VAR1);
//
void setup()
{
  gw.begin(NULL, RADIO_ID, false);
  #ifdef DEBUG
    Serial.begin(115200);
  #endif
  gw.sendSketchInfo("MotionSensor", "V1.1");
  pinMode(DIGITAL_INPUT_SENSOR, INPUT);
  gw.present(CHILD_ID, S_MOTION);
}
//
void loop()
{
  boolean sensorState = digitalRead(DIGITAL_INPUT_SENSOR);
  if (sensorState != lastSensorState)
  {
    #ifdef DEBUG
      digitalWrite(13, sensorState ? HIGH : LOW);
      Serial.println(sensorState ? "Tripped" : "Not Tripped");
    #endif
    gw.send(stateMsg.set(sensorState ? "1" : "0"));
  }
  lastSensorState = sensorState;
  updateStatus(UPDATE_INTERVAL);
}
//
void updateStatus(unsigned long updateInterval)
{
  static unsigned long lastUpdate;
  if (millis() - lastUpdate &gt;= updateInterval)
  {
    gw.send(updateMsg.set(lastSensorState ? "Motion Detected" : "No Motion"));
    #ifdef DEBUG
      digitalWrite(13, lastSensorState ? HIGH : LOW);
      Serial.println(lastSensorState ? F("Tripped") : F("Not Tripped"));
    #endif
    lastUpdate += updateInterval;
  }
}
</code></pre>
]]></description><link>https://forum.mysensors.org/post/6789</link><guid isPermaLink="true">https://forum.mysensors.org/post/6789</guid><dc:creator><![CDATA[BulldogLowell]]></dc:creator><pubDate>Sun, 16 Nov 2014 15:05:22 GMT</pubDate></item></channel></rss>