Project

General

Profile

MySensors

With commit commit:e6f4b140 / the 1.0.017 release DomotiGa has support for MySensors.

MySensors uses the Arduino platform with the nRF24L01+ radio and an open source software library to create, do-it-youself low cost wireless sensors, see http://www.mysensors.org for details.

The current implementation of the MySensors plugin supports the serial gateway and the Ethernet gateway. Furthermore it supports relay functionality (not tested yet).

Tested MySensors version

The following list of MySensors version have been successfully tested with DomotiGa:

MySensor Version
v1.4
v1.5
v2.0-beta

Configuration

You can enable the MySensors plugin under Interface --> MySensors


 
  • With the InterfaceType you select either the serial or the ethernet gateway
  • TCP Host and TCP Port give the name or IP address and port the ethernet gateway can be reached
  • Serial Port gives the serial USB port the serial gateway can be found
  • You can change the Baud Rate if you do not use the default baudrate of 115k2
  • When Relay Enabled is selected data that is received from the gateway can be shared with others that can connect to the port given by the Relay Port field
  • If Use Ack is set, outgoing message will have a flag set requesting for an Ack and thereby triggering retransmit in the case a packet is lost
  • By enabling Debug you get debug output that includes all shared between the gateway and DomotiGa (the controller in MySensors terms)
     

Setting values

  • Create a value for the device that maps to the child-sensor-id (so ValueX with X being the child-sensor-id's + 1)
  • Put in the Description of the value the sub-type, so V_LIGHT / V_DIMMER etc.

When a SendCommand is addressed to the MySensor plugin it will scan all values of the device/node and that the first value that has in the description V_LIGHT / V_DIMMER etc. That string will be used as sub-type for the MySensors SET message.

Debug

When you enable debug, restart and have a node without valid address the debug log will show something like:

16:14:04 [MySensors] < 0;0;3;0;14;Gateway startup complete.
16:14:04 [MySensors] Gateway ready: "Gateway startup complete." 
16:14:04 [MySensors] Ask gateway for it's version
16:14:04 [MySensors] > 0;0;3;0;2;
16:14:04 [MySensors] < 0;0;3;0;2;1.5.4
16:14:04 [MySensors] Version of the MySensors gateway is '1.5.4'.
16:14:31 [MySensors] < 0;0;3;0;9;read: 255-255-0 s=255,c=3,t=3,pt=0,l=0:
16:14:31 [MySensors] Gateway log message: read: 255-255-0 s=255,c=3,t=3,pt=0,l=0:
16:14:31 [MySensors] < 255;255;3;0;3;
16:14:31 [MySensors] Providing node id 1
16:14:31 [MySensors] > 255;255;3;0;4;1
16:14:32 [MySensors] < 0;0;3;0;9;send: 0-0-255-255 s=255,c=3,t=4,pt=0,l=1,st=fail:1
16:14:32 [MySensors] Gateway log message: send: 0-0-255-255 s=255,c=3,t=4,pt=0,l=1,st=fail:1
16:15:19 [MySensors] < 0;0;3;0;9;read: 1-1-0 s=0,c=1,t=23,pt=3,l=2:272
16:15:19 [MySensors] Gateway log message: read: 1-1-0 s=0,c=1,t=23,pt=3,l=2:272
16:15:19 [MySensors] < 1;0;1;0;23;272
16:15:19 [MySensors] Set value '272' for node 1
16:15:19 [Devices] Device with type 'MySensors', address '1', instance 1' and interface 'MySensors Interface' not found!
16:15:19 [Devices] Auto created device 'MySensors device #1' with address '1' of type 'MySensors Node' with interface 'MySensors Interface' and instance '1'
16:15:38 [MySensors] < 0;0;3;0;9;read: 1-1-0 s=0,c=1,t=23,pt=3,l=2:265
16:15:38 [MySensors] Gateway log message: read: 1-1-0 s=0,c=1,t=23,pt=3,l=2:265
16:15:38 [MySensors] < 1;0;1;0;23;265
16:15:38 [MySensors] Set value '265' for node 1
16:16:10 [MySensors] < 0;0;3;0;9;read: 1-1-0 s=0,c=1,t=23,pt=3,l=2:257
16:16:10 [MySensors] Gateway log message: read: 1-1-0 s=0,c=1,t=23,pt=3,l=2:257
16:16:10 [MySensors] < 1;0;1;0;23;257
16:16:10 [MySensors] Set value '257' for node 1
16:16:42 [MySensors] < 0;0;3;0;9;read: 1-1-0 s=0,c=1,t=23,pt=3,l=2:252
16:16:42 [MySensors] Gateway log message: read: 1-1-0 s=0,c=1,t=23,pt=3,l=2:252
16:16:42 [MySensors] < 1;0;1;0;23;252

To decode the messages like "< 1;0;1;0;23;272" see http://www.mysensors.org/build/serial_api

Implementation Notes

  • A MySensors Node can have multiple (child-)sensor-id's; for every (child-)sensor-id a separate DomotiGa device is created where the address is set to <node-id>.<sensor-id>.
  • The data provided in Presentation messages and the Set/Req sub-type is not yet used

Supported/not (yet) supported

Supported

Hardware Protocol
  • MySensors Serial Protocol (1.4/1.5)
  • Set messages (C_SET)
  • Request messages (C_REQ) (not tested yet)
  • Internal messages (C_INTERNAL)
    • Providing nodes an ID (I_ID_REQUEST/I_ID_RESPONSE)
    • Nodes reporting their battery level (I_BATTERY_LEVEL)
    • Nodes requesting the time (I_TIME)
    • Nodes requesting the config (I_CONFIG)

Not (yet) supported

Hardware Protocol
  • Presentation messages (C_PRESENTATION) are only logged
  • Stream messages (C_STREAM)

Error executing the comments macro (undefined method `id' for nil:NilClass)

Updated by: Alexie, Updated over 2 years ago
Access count: 51626 since 2014-10-24

Attached Files

Also available in: PDF HTML TXT