1+ <?php
2+ /* Device definitions
3+ *
4+ * JSON object structure of each device is used for GET data for setting new values
5+ * For example:
6+ * JSON status of device: {"servo_attached":1,"door_angle":130}
7+ *
8+ * Setting servo_attached to 0 can be done by sending the GET command to the device status address
9+ * with JSON data {"servo_attached":0}.
10+ *
11+ */
12+
13+
14+ // EXAMPLE CONFIG FOR TWO NODES:
15+ $ id =0 ;
16+ $ device_name [$ id ]="Tuinhuis " ;
17+ $ device_address [$ id ]="http://192.168.1.35 " ;
18+ $ device_sensors [$ id ]=array (
19+ // supported types: boolean, integer, float, string
20+ // supported operators: w (writeable), c (writeable config). r (read-only)
21+ // "ip" => array("IP adres", "string", "r"),
22+ // "ssid" => array("WIFI SSID", "string", "r"),
23+ "rssi " => array ("WIFI RSSI (dB) " , "integer " , "r " ),
24+ "relay_state " => array ("Lamp tuinhuis " , "boolean " , "w " ),
25+ "servo_attached " => array ("Servo actief " ,"boolean " , "w " ),
26+ "servo_ref_angle " => array ("Deur ingestelde hoek (graden) " , "integer " , "w " ),
27+ "servo_angle " => array ("Deur hoek (graden) " , "integer " , "r " ),
28+ "loadcell_value_b " => array ("Zitstok gewicht (L) " , "float " , "r " ),
29+ "loadcell_value_a " => array ("Zitstok gewicht (R) " , "float " , "r " ),
30+ "loadcell_tare_b " => array ("Zitstok tare (L) " , "float " , "c " ),
31+ "loadcell_tare_a " => array ("Zitstok tare (R) " , "float " , "c " ),
32+ "loadcell_scale_b " => array ("Zitstok schaling (L) " , "float " , "c " ),
33+ "loadcell_scale_a " => array ("Zitstok schaling (R) " , "float " , "c " )
34+ );
35+
36+
37+
38+ $ id =1 ;
39+ $ device_name [$ id ]="Voordeur " ;
40+ $ device_address [$ id ]="http://192.168.1.31/ " ;
41+ $ device_sensors [$ id ]=array (
42+ // "ip" => array("IP adres", "string", "r"),
43+ // "ssid" => array("WIFI SSID", "string", "r"),
44+ "rssi " => array ("WIFI RSSI (dB) " , "integer " , "r " ),
45+ "deurbel_status " => array ("Deurbel ingedrukt " ,"boolean " , "r " ),
46+ "lamp_status " => array ("Lamp voordeur " , "boolean " , "w " )
47+ );
48+ ?>
0 commit comments