Skip to content
Carsten Agerskov edited this page Oct 27, 2015 · 3 revisions

The Arduino code is based on the MySensors Library

The code is available in the GitHub repo or on codebender

The MySensor Node ID

In my setup, the MySensor node ID is hardcoded, this node is node 50. This is set using the commands

int node_id = 50;
gw.begin(NULL,node_id);

If you want the node ID auto assigned, use

gw.begin();

instead.

However, if you use another node ID, or auto assign it, remember to change your OpenHAB item bindings accordingly.

Adjusting the thresholds.

The thresholds are set in the code as 'define' values, in the file PBMonitor.ino file. You may have to adjust these thresholds according to light conditions and/or photoresistors used. The code defining the thresholds are:

#define THRESHOLD_STANDBY 400
#define THRESHOLD_LOW_POWER 400
#define THRESHOLD_HIGH_POWER 400

Explanation of MySensor messages

The project use two messages, one for the alarm, and one for the burner run state. Defined by

#define CHILD_ID_STATE 1`
#define CHILD_ID_ALARM 2`

Both are variable type S_CUSTOM, the state is of sub-type V_VAR1 and the alarm is of sub-type V_TRIPPED.

The states used for V_VAR1 is defined as:

#define STAND_BY 0`
#define START 1`
#define LOW_POWER 2`
#define HIGH_POWER 3`

In OpenHAB maps are defined for both state and alarm.

Clone this wiki locally