DISCONTINUED: If I continue in this direction it will be “my” other wifi gateway option.

And … another workaround as long as we don’t have a pimatic-mysensors ethernet plugin.
Really by accident I bumped into pymysensors. This is an option to communicate with python to a mysensors Esp8266gateway (or serial gateway). So I forked the repo and started extending it, also by using some parts of @MrSponti’s work. My repo has a pimatic specific part that enables to currently read sensors from the “mysensors network” and push those as variables into pimatic. More or less as you would do with Espimatic.

The second reason I dived into pymysensors is that it has a serial gateway and an ethernet gateway. I do understand python and do understand the differences :-)
I hope to be able by comparing the serial and ethernet part in python to do “something” in coffeescript for the plugin.

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": "pymysensorstuin",
      "name": "Tuin",
      "class": "VariablesDevice",
      "variables": [
        {
          "name": "node2sensor0",
          "type": "number",
          "expression": "$2-0",
          "label": "temperatuur"
        },
        {
          "name": "node2sensor255",
          "type": "number",
          "expression": "$2-255",
          "label": "batterij"
        }
      ]
    },
    {
      "id": "pymysensorsextra",
      "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
    }

This is really basic. I want to be able to make the python script run as a daemon being able to “sudo service pimatic-pymysensors stop/start/restart/status” and the like.
The difference with socat is that this is really stable (like the GatewayESP8266MQTTClient) and it uses the simple pimatic API.

Actually I also use an extra device & variable to do some debugging and send the complete string

    {
      "id": "pymysensorsstring",
      "name": "pymysensors string",
      "class": "VariablesDevice",
      "variables": [
        {
          "name": "pymysensorsstring",
          "type": "string",
          "expression": "$pymysensors",
          "label": "pymysensors"
        }
      ]
    },

and

    {
      "name": "pymysensors",
      "value": "5;0;1;0;0;16.0"
    },

or for example when starting up

    {
      "name": "pymysensors",
      "value": "0;0;3;0;14;Gateway startup complete."
    },

Next step is to create a push script to be called from pimatic to push values to a switch or dimmer (and at the same time try to figure out how to do that in the real pimatic-mysensors plugin)

DISCONTINUED: If I continue in this direction it will be “my” other wifi gateway option.