config.json unnecessarily large cause of old devices

Discussions about Z-Way software and Z-Wave technology in general
Post Reply
piet66
Posts: 266
Joined: 04 Feb 2017 17:00

config.json unnecessarily large cause of old devices

Post by piet66 »

In my config.json there is a very large number of physical and virtual devices which are not existing any more for long time.
It doesn't seem to have any negative effect. But I don't think it's good. The file is unnecessarily large.

Is there a possibility to clean it?
Raspberry Pi 3 Model B Rev 1.2
Raspbian GNU/Linux 10 (buster, 32bit)
RaZberry by Z-Wave.Me ZW0700 7.20.00 07.38/1766938484 1025/257
Z-Way version v3.2.3 from 2022-04-06 04:56:23 +0300
User avatar
PoltoS
Posts: 7565
Joined: 26 Jan 2011 19:36

Re: config.json unnecessarily large cause of old devices

Post by PoltoS »

Normally when Z-Wave Binding module is removing Z-Wave Devices it cleans this info. But other modules do not. This is because we do not have any onRemove event. So currently it is not possible
piet66
Posts: 266
Joined: 04 Feb 2017 17:00

Re: config.json unnecessarily large cause of old devices

Post by piet66 »

In my config.json there are at the moment totally 650 devices mentioned in vdevInfo and in profiles, 249 of these devices are existing at the moment, 401 devices are no longer existing and could be removed.
Here a list of the old devices (incomplete):
You can see at the end, that there are even physical devices, which are no more existing.
Seems that removal doesn't work correctly.

If it's not possibly to remove the devices at once, would be useful to have a cyclic function for cleaning up.

Code: Select all

List: 401 old devices in config.json, sorted by id
[
    "AdvancedThermostatDevice_Switch_116",
    "AdvancedThermostatDevice_Switch_54",
    "AdvancedThermostatDevice_Thermostat_116",
    "AdvancedThermostatDevice_Thermostat_54",
    "BatteryPolling_135",
    "ConditionSwitch_130",
    "ConditionSwitch_132",
    "ConditionSwitch_48",
    "ConditionSwitch_49",
    "ConditionSwitch_50",
    "ConditionSwitch_86",
    "Configurator_445",
    "DummyDevice_27",
    "DummyDevice_36",
    "EnhancedThermostatDevice_Switch_56",
    "EnhancedThermostatDevice_Thermostat_56",
    "ForecastIO_barometer_152",
    "ForecastIO_cloudCover_152",
    "ForecastIO_current_152",
    "ForecastIO_forecastHigh_152",
    "ForecastIO_forecastLow_152",
    "ForecastIO_forecast_152",
    "ForecastIO_humidity_152",
    "ForecastIO_solar_152",
    "ForecastIO_wind_152",
    "Multiline_147",
    "Multiline_156",
    "Multiline_157",
    "Multiline_158",
    "Multiline_159",
    "Multiline_160",
    "Multiline_189",
    "Multiline_194",
    "Multiline_209",
    "Multiline_213",
    "Multiline_216",
    "Multiline_219",
    "Multiline_247",
    "Multiline_249",
    "Multiline_271",
    "Multiline_355",
    "Multiline_67",
    "Multiline_68",
    "Multiline_69",
    "Multiline_94",
    ...
    "OpenWeatherDaylight_406",
    "OpenWeather_406",
    "Presence_night_34",
    "Presence_night_63",
    "Presence_presence_34",
    "Presence_presence_63",
    "Presence_vacation_34",
    "Presence_vacation_63",
    "ThermostatControl_Switch_54",
    "ThermostatControl_Switch_55",
    "ThermostatControl_Thermostat_54",
    "ThermostatControl_Thermostat_55",
    "ThermostatDevice_55",
    "TimerSwitch_133",
    "TimerSwitch_23",
    "TimerSwitch_310",
    "TimerSwitch_312",
    "TimerSwitch_51",
    "TimerSwitch_52",
    "WeatherUnderground_barometer_59",
    "WeatherUnderground_barometer_62",
    "WeatherUnderground_current_59",
    "WeatherUnderground_current_62",
    "WeatherUnderground_feelslike_62",
    "WeatherUnderground_forecastHigh_59",
    "WeatherUnderground_forecastHigh_62",
    "WeatherUnderground_forecastLow_59",
    "WeatherUnderground_forecastLow_62",
    "WeatherUnderground_forecastToday_62",
    "WeatherUnderground_forecast_59",
    "WeatherUnderground_forecast_62",
    "WeatherUnderground_humidity_59",
    "WeatherUnderground_humidity_62",
    "WeatherUnderground_solar_59",
    "WeatherUnderground_solar_62",
    "WeatherUnderground_uv_59",
    "WeatherUnderground_uv_62",
    "WeatherUnderground_wind_59",
    "WeatherUnderground_wind_62",
    "ZWayVDev_zway_10-0-113-4-2-A",
    "ZWayVDev_zway_10-0-113-4-6-A",
    "ZWayVDev_zway_10-0-113-6-Door-A",
    "ZWayVDev_zway_10-0-113-7-3-A",
    "ZWayVDev_zway_10-0-113-9-1-A",
    "ZWayVDev_zway_10-0-128",
    "ZWayVDev_zway_10-0-156-0-A",
    "ZWayVDev_zway_10-0-48-1",
    "ZWayVDev_zway_10-0-49-1",
    "ZWayVDev_zway_11-0-128",
    "ZWayVDev_zway_11-0-48-1",
    "ZWayVDev_zway_11-0-49-1",
    "ZWayVDev_zway_12-0-113-4-2-A",
    "ZWayVDev_zway_12-0-113-4-6-A",
    "ZWayVDev_zway_12-0-113-6-Door-A",
    "ZWayVDev_zway_12-0-113-7-3-A",
    "ZWayVDev_zway_12-0-113-9-1-A",
    "ZWayVDev_zway_12-0-128",
    "ZWayVDev_zway_12-0-156-0-A",
    "ZWayVDev_zway_12-0-48-1",
    "ZWayVDev_zway_12-0-49-1",
    "ZWayVDev_zway_14-0-37",
    "ZWayVDev_zway_14-0-49-1",
    "ZWayVDev_zway_14-0-50-0",
    "ZWayVDev_zway_14-0-50-2",
    "ZWayVDev_zway_14-1-37",
    "ZWayVDev_zway_14-1-50-0",
    "ZWayVDev_zway_14-1-50-2",
    "ZWayVDev_zway_14-2-37",
    "ZWayVDev_zway_14-2-50-0",
    "ZWayVDev_zway_14-2-50-2",
    "ZWayVDev_zway_14-3-49-1",
    "ZWayVDev_zway_15-0-113-6-Door-A",
    "ZWayVDev_zway_15-0-128",
    "ZWayVDev_zway_17-0-113-7-3-A",
    "ZWayVDev_zway_17-0-128",
    "ZWayVDev_zway_17-0-48-1",
    "ZWayVDev_zway_17-0-49-1",
    "ZWayVDev_zway_17-0-49-27",
    "ZWayVDev_zway_17-0-49-3",
    "ZWayVDev_zway_17-0-49-5",
    "ZWayVDev_zway_19-0-113-4-2-A",
    "ZWayVDev_zway_19-0-113-4-6-A",
    "ZWayVDev_zway_19-0-113-6-Door-A",
    "ZWayVDev_zway_19-0-113-7-3-A",
    "ZWayVDev_zway_19-0-113-9-1-A",
    "ZWayVDev_zway_19-0-128",
    "ZWayVDev_zway_19-0-49-1",
    "ZWayVDev_zway_21-0-128",
    "ZWayVDev_zway_21-0-49-1",
    "ZWayVDev_zway_24-0-37",
    "ZWayVDev_zway_24-0-49-1",
    "ZWayVDev_zway_24-0-50-0",
    "ZWayVDev_zway_24-0-50-2",
    "ZWayVDev_zway_24-1-37",
    "ZWayVDev_zway_24-1-50-0",
    "ZWayVDev_zway_24-1-50-2",
    "ZWayVDev_zway_24-2-37",
    "ZWayVDev_zway_24-2-50-0",
    "ZWayVDev_zway_24-2-50-2",
    "ZWayVDev_zway_24-3-49-1",
    "ZWayVDev_zway_26-0-113-7-3-A",
    "ZWayVDev_zway_29-2-49-1",
    "ZWayVDev_zway_30-0-37",
    "ZWayVDev_zway_30-0-49-1",
    "ZWayVDev_zway_30-0-50-0",
    "ZWayVDev_zway_30-0-50-2",
    "ZWayVDev_zway_30-1-37",
    "ZWayVDev_zway_30-1-50-0",
    "ZWayVDev_zway_30-1-50-2",
    "ZWayVDev_zway_30-2-37",
    "ZWayVDev_zway_30-2-50-0",
    "ZWayVDev_zway_30-2-50-2",
    "ZWayVDev_zway_30-3-49-1",
    "ZWayVDev_zway_36-0-37",
    "ZWayVDev_zway_36-0-49-1",
    "ZWayVDev_zway_36-0-50-0",
    "ZWayVDev_zway_36-0-50-2",
    "ZWayVDev_zway_36-1-37",
    "ZWayVDev_zway_36-1-50-0",
    "ZWayVDev_zway_36-1-50-2",
    "ZWayVDev_zway_36-2-37",
    "ZWayVDev_zway_36-2-50-0",
    "ZWayVDev_zway_36-2-50-2",
    "ZWayVDev_zway_36-3-49-1",
    "ZWayVDev_zway_4-0-113-6-Door-A",
    "ZWayVDev_zway_4-0-113-7-4-A",
    "ZWayVDev_zway_4-0-128",
    "ZWayVDev_zway_4-0-48-1",
    "ZWayVDev_zway_4-0-49-1",
    "ZWayVDev_zway_4-0-64",
    "ZWayVDev_zway_4-0-67-1",
    "ZWayVDev_zway_5-0-37",
    "ZWayVDev_zway_5-0-49-1",
    "ZWayVDev_zway_5-0-50-0",
    "ZWayVDev_zway_5-0-50-2",
    "ZWayVDev_zway_5-0-67-1",
    "ZWayVDev_zway_5-1-37",
    "ZWayVDev_zway_5-1-49-1",
    "ZWayVDev_zway_5-1-50-0",
    "ZWayVDev_zway_5-1-50-2",
    "ZWayVDev_zway_5-2-37",
    "ZWayVDev_zway_5-2-50-0",
    "ZWayVDev_zway_5-2-50-2",
    "ZWayVDev_zway_5-3-37",
    "ZWayVDev_zway_5-3-49-1",
    "ZWayVDev_zway_6-0-113-7-254-A",
    "ZWayVDev_zway_6-0-64",
    "ZWayVDev_zway_6-0-67-1",
    "ZWayVDev_zway_7-0-49-1",
    "ZWayVDev_zway_7-0-64",
    "ZWayVDev_zway_7-0-67-1",
    "ZWayVDev_zway_9-0-113-4-2-A",
    "ZWayVDev_zway_9-0-113-4-6-A",
    "ZWayVDev_zway_9-0-113-6-Door-A",
    "ZWayVDev_zway_9-0-113-7-3-A",
    "ZWayVDev_zway_9-0-113-9-1-A",
    "ZWayVDev_zway_9-0-128",
    "ZWayVDev_zway_9-0-156-0-A",
    "ZWayVDev_zway_9-0-48-1",
    "ZWayVDev_zway_9-0-49-1",
    "ZWayVDev_zway_9-0-49-27",
    "ZWayVDev_zway_9-0-49-3",
    "ZWayVDev_zway_9-0-49-5"
]
Raspberry Pi 3 Model B Rev 1.2
Raspbian GNU/Linux 10 (buster, 32bit)
RaZberry by Z-Wave.Me ZW0700 7.20.00 07.38/1766938484 1025/257
Z-Way version v3.2.3 from 2022-04-06 04:56:23 +0300
piet66
Posts: 266
Joined: 04 Feb 2017 17:00

Re: config.json unnecessarily large cause of old devices

Post by piet66 »

I removed all old devices.
config.json size has shrunk from 517,1 KiB to 244,0 KiB and start of z-way-server is much faster now.
Raspberry Pi 3 Model B Rev 1.2
Raspbian GNU/Linux 10 (buster, 32bit)
RaZberry by Z-Wave.Me ZW0700 7.20.00 07.38/1766938484 1025/257
Z-Way version v3.2.3 from 2022-04-06 04:56:23 +0300
tomshuette
Posts: 73
Joined: 29 Nov 2016 11:26

Re: config.json unnecessarily large cause of old devices

Post by tomshuette »

How removed ?
piet66
Posts: 266
Joined: 04 Feb 2017 17:00

Re: config.json unnecessarily large cause of old devices

Post by piet66 »

- Wrote a tool which stored an array of old device-ids to a file.
- Added some code to updateBackendConfig.js to read this file and remove all entries from config.json
- Restart
Raspberry Pi 3 Model B Rev 1.2
Raspbian GNU/Linux 10 (buster, 32bit)
RaZberry by Z-Wave.Me ZW0700 7.20.00 07.38/1766938484 1025/257
Z-Way version v3.2.3 from 2022-04-06 04:56:23 +0300
Post Reply