How To Add A Schedule Heartbeat For The SmartServer IoT (KB1427)

Some sites require you to have some of Schedule outputs be sent periodically so if an edge device reboots it has the required settings.  This is referred to as a schedule heartbeat.   


The Scheduler doesn't have a way to heartbeat the value. Currently there is no feature in the CMS Web pages to provide this feature but you can do this programmatically or contact support to see if there is a tool or Internal IAP App available.


The CMS Datapoint Properties has a configuration for heartbeats but would control all devices with this device types.  The CMS Web pages do not have a way to configure heartbeats for individual datapoints but you can use MQTT or REST requests to set heartbeats.


For LON devices you can use MQTT or REST to send commands to change propagationHeartbeat which is used to set the devices input datapoint heartbeat for sending out the current value out periodically to external devices.  Currently there is no way to do this for BACnet or Modbus devices. 


MQTT is easier to use as you don't have to use a program to configure the heartbeat.


The MQTT example below shows how to configure a datapoint heartbeat using a ssh command. You can use something like MQTT Explorer to verify that your heartbeats are configure correctly.   You can also use the CMS Datapoint Widget Action menu to select "Show Detailed Properties" to see the dpQuailfier which has most of the information you need for the MQTT request.  Just make sure you do a request "/rq/" and not a "/fb/".


For powerline repeating networks the minimum heartbeat should be of 600 seconds. 

MQTT (LON devices only):

Format:  <device DID>/<blockName>/<blockIndex/<datapointXifName>


mosquitto_pub -t glp/0/<SmartServer SID>/rq/dev/lon/<device DID>/if/<blockName>/<blockIndex/ <datapointXifName>  /monitor/lon.cfg/propagationHeartbeat -m "60"


SID and DID are shown in the CMS Device Widget by selecting the "View All Properties" in the Widget action menu.

Example using SmartServer ssh/console command:  "3/if/Lamp/0/nviValue", SID = 17qehie, heartbeat every 60 seconds


mosquitto_pub -t glp/0/17qehie/rq/dev/lon/3/if/Lamp/0/nviValue/monitor/lon.cfg/propagationHeartbeat -m "60"




REST API (LON devices only): 

you need to do a read modified write
GET /iap/devs/*+name==Sensor 1/if/Lamp/0/nviLamp/monitor

[{"deviceId":3,"deviceName":"Sensor 1","deviceHealth":"normal","deviceState":"provisioned","blockName":"Lamp","blockIndex":0,"utc":"2021-06-09T20:33:12.929Z[UTC]","local":"2021-06-09T13:33:12.929-07:00[America/Los_Angeles]","dpQualifier":"17qam77/lon/3/Lamp/0/nviLamp","datapointName":"nviLamp","name":"nviLamp","presetValue":null,"locValue":{"value":0,"state":0},"monitor":{"cat":"data","rate":150,"event":false,"focus":null,"health":"normal","report":"any","lon.cfg":{"propagationThrottle":0,"propagationHeartbeat":27,"propagationThreshold":0},"throttle":35,"heartbeat":58,"threshold":0,"inFeedback":false,"receiveTimeout":0}}]


Change propagationHeartbeat=42. Don't include "monitor": in your PUT payload

PUT
/iap/devs/*+name==Sensor 1/if/Lamp/0/nviLamp/monitor
Payload:
{"cat":"data","rate":150,"event":false,"focus":null,"health":"normal","report":"any","lon.cfg":{"propagationThrottle":0,"propagationHeartbeat":42,"propagationThreshold":0},"throttle":35,"heartbeat":58,"threshold":0,"inFeedback":false,"receiveTimeout":0}