MySensors, adjust json persistence file instead of edit sensors nodes

Hello,

I am new to HA since recently, but have now built more than 10 sensor nodes, according to the integration page I would have to adjust all nodes because HA first wants to receive the value of all V_TYPE.

Now that is not a big job for a single sensor, but of course for +10 sensors, so I tried to adjust the mysensors.json file by adding the values in it.

The way of working:

-disable the MySensors intergration in configuration.yaml
-restart HA
-edit the MySensors.json file (in used Notepad ++)
-Write the file in the config folder
-enable the MySensors integration again in configuration.yaml
-restart HA

  • look into the development tools -> states

if all is well you will see the sensors in between, and in the User Interface you can add them and switch them there too.

You just have to adjust the names separately.

So it saves a lot of work by modifying the MySensors.json file instead of modifying the nodes, although I am going to create new ones as they should with HA.

"101": {
        "sensor_id": 101,
        "children": {
            "21": {
                "id": 21,
                "type": 6,
                "description": "Temp in put node",
                "values": {}
            },
            "1": {
                "id": 1,
                "type": 3,
                "description": "Put Klep-1",
                "values": {
					"2": "0"
				}
            },
            "11": {
                "id": 11,
                "type": 35,
                "description": "Put Grondvocht-1",
                "values": {
                    "37": "153"
                }
            },
   
        "type": 17,
        "sketch_name": "PutSensor Node",
        "sketch_version": "2.0",
        "battery_level": 0,
        "protocol_version": "2.3.1",
        "heartbeat": 0
    },

the only thing I have to figure out is which value belongs to which V_TYPE, so for the V_STATUS it is “2”: “0”

Is there perhaps an overview with which value belongs to which V_TYPE?

It saved me some time, of course I only have to adjust the values for the T_TYPE that do not send a value (periodically).

Perhaps an idea to add it in the integration page?

1 Like

Thanks for posting this. I may try it when I add my new nodes. I’m still working on migrating to Home Assistant from Vera. I haven’t looked into it too much but it would be great to use the MySensors Present function for setting up the nodes in Home Assistant. I hope to look into this someday but I have been sidetracked by other things.

Thanks for this,
Works perfectly and saves having to adjust all of the nodes that are already built from another project.

Thank you for sharing your solution! I’m currently moving hundreds of MySensors devices from Domoticz to Home Assistant. Now I am wondering how can I edit the Entities names at once? At the moment they are all named by Sketchname/node/child. Domoticz was using the CHILD description - this is available in the config, but I cannot find a way to use this as Entity name by default. Through UI it will take much more time then just edit some text file/table etc.