Esp8266GatewayPimatic
This mysensors EspGateway2866 pushes sensor values directly to Pimatic via the REST-API.
You find it in my Esp8266GatewayPimatic repository. It currently only reads sensor values. It does not write sensor values back into the network. It is of course very limited compared to the GatewayESP8266MQTTClient but it is an extremely simple implementation not needing any plugins.
It is based on this post in the mysensors forum leading to this repository.
I combined a few things, copied a few things left and right and came up with this new ino.
I included a Base64 library which is not by default included in the arduino package and which is definitely not the same as the base64 library inside the arduino library (note the Base64 vs. the base64). You need to copy this library into the libraries folder of your arduino setup, not in the mysensors setup.
Currently this ino receives sensor values from the mysensors network and pushes them as variables with their value to pimatic. Say you have a temperature sensor as node 2 child 0 with (temp) value 21.6. The variable pushed to pimatic will be “2-0”, the value will of course be “21.6”.
It is done in a mysensors 1.5 format as I have no idea how to do it in mysensors 2.0 format.
The current version is for the mysensors 2.0 version and, as mentioned above, it can be found here. If you want the previous version for the mysensors 1.5 version libraries, check here.
It is all very simple: mysensors has node and sensor(child) like 5/0 or 5/255 (battery). I simply provide that as variable 5-0 or 5-255 to pimatic with their respective values.
2 devices for 2 sensors
{
"id": "mysensorstuin",
"name": "Tuin",
"class": "VariablesDevice",
"variables": [
{
"name": "node2sensor0",
"type": "number",
"expression": "$2-0",
"label": "temperatuur"
},
{
"name": "node2sensor255",
"type": "number",
"expression": "$2-255",
"label": "batterij"
}
]
},
{
"id": "mysensorsextra",
"name": "Extra",
"class": "VariablesDevice",
"variables": [
{
"name": "node5sensor0",
"type": "number",
"expression": "$5-0",
"label": "temperatuur"
},
{
"name": "node5sensor255",
"type": "number",
"expression": "$5-255",
"label": "batterij"
}
]
}
And 4 variables:
{
"name": "2-0",
"value": 10.8
},
{
"name": "2-255",
"value": 92
},
{
"name": "5-0",
"value": 16
},
{
"name": "5-255",
"value": 100
}