smar000 / evoGateway

Python script for listening in and responding to evohome heating control radio messages
46 stars 17 forks source link

Schema file missing or the 'known_list' section is missing #51

Closed chris-hunter closed 1 year ago

chris-hunter commented 1 year ago

Since upgrading to v3.13-0.22.40 I'm having issues with loading the schema file and get the following error: Schema file missing or the 'known_list' section is missing. Defaulting to ramses_rf 'eavesdropping' mode It then seems to go on and load my devices file and the aliases, but by then is in eavesdropping mode and overwrites my ramses_rf_schema.json file at the end. I am able to use client.py in ramses_rf and have copied the config.json file across as my ramses_rf_schema.json file.

ramses_rf_schema.json.txt devices.json.txt

smar000 commented 1 year ago

There have been quite a few changes in the schema side of things, to bring us up to date with the current ramses library. Having said that, it appears to be working on my side without any issues.

As a test, can you try changing "enforce_known_list": true to "enforce_known_list": false in the schema file and see if it still gives the same error? Also I assume that the schema file name in your config file is correct?

chris-hunter commented 1 year ago

Thanks I get the same error in if I change "enforce_known_list" to false. It seems to be loading my devices.json and zone json files. My evogateway.cfg file has SCHEMA_FILE = ramses_rf_schema.json, which is was my schema file is called (in the same folder). I note that evogateway.py line 129 SCHEMA_FILE = config.get("Files", "SCHEMA_FILE", fallback="ramsesrf_schema.json" I presume this is a typo, but it isn't affecting me as I have SCHEMA_FILE in my config file. Would it be possible to post a sample ramses_rf_schema.json file to see if there is a mistake in the way I've formatted my file?

smar000 commented 1 year ago

I have tried your schema and devices files and both load up without issues at my end.

Would it be possible to post a sample ramses_rf_schema.json file to see if there is a mistake in the way I've formatted my file?

Sure. Here is my one (slightly redacted):

{
    "config": {
        "disable_sending": false,
        "disable_discovery": true,
        "enforce_known_list": false,
        "evofw_flag": null,
        "max_zones": 12,
        "reduce_processing": 0,
        "use_aliases": true
    },
    "main_tcs": "01:xxxxxx",
    "01:xxxxxx": {
        "system": {
            "appliance_control": "10:142568"
        },
        "orphans": [
            "02:043392"
        ],
        "stored_hotwater": {
            "sensor": "07:043555",
            "hotwater_valve": "13:133904",
            "heating_valve": "13:102710"
        },
        "underfloor_heating": {
            "02:043392": {
                "circuits": {
                    "00": {
                        "zone_idx": "07"
                    },
                    "01": {
                        "zone_idx": "0A"
                    },
                    "02": {
                        "zone_idx": "0B"
                    }
                }
            }
        },
        "zones": {
            "00": {
                "_name": "Living Room",
                "class": "radiator_valve",
                "sensor": "34:015243",
                "actuators": [
                    "04:228044",
                    "04:143928",
                    "04:143926",
                    "04:143922"
                ]
            },
            "01": {
                "_name": "Mstr Bedroom",
                "class": "radiator_valve",
                "sensor": "04:143924",
                "actuators": [
                    "04:227952"
                ]
            },
            "02": {
                "_name": "aaa's Room",
                "class": "radiator_valve",
                "sensor": "04:228096",
                "actuators": [
                    "04:228042"
                ]
            },
            "03": {
                "_name": "bbb's Room",
                "class": "radiator_valve",
                "sensor": "04:227954",
                "actuators": [
                    "04:227954"
                ]
            },
            "04": {
                "_name": "ccc's Room",
                "class": "radiator_valve",
                "sensor": "04:000868",
                "actuators": [
                    "04:000868"
                ]
            },
            "05": {
                "_name": "Office",
                "class": "radiator_valve",
                "sensor": "04:228048",
                "actuators": [
                    "04:228048"
                ]
            },
            "06": {
                "_name": "Garage",
                "class": "zone_valve",
                "sensor": "34:231315",
                "actuators": [
                    "13:230917"
                ]
            },
            "07": {
                "_name": "Dining Room",
                "class": "underfloor_heating",
                "sensor": "01:139901",
                "actuators": []
            },
            "08": {
                "_name": "Landing",
                "class": "radiator_valve",
                "sensor": "04:001048",
                "actuators": [
                    "04:001048"
                ]
            },
            "09": {
                "_name": "Bathroom",
                "class": "radiator_valve",
                "sensor": "04:228094",
                "actuators": [
                    "04:228094"
                ]
            },
            "0A": {
                "_name": "Kitchen UFH",
                "class": "underfloor_heating",
                "sensor": "34:112193",
                "actuators": []
            },
            "0B": {
                "_name": "Hallway",
                "class": "underfloor_heating",
                "sensor": "34:214769",
                "actuators": []
            }
        }
    },
    "orphans_heat": [
        "02:043392",
        "13:102710",
        "13:133904",
        "34:214769",
        "34:231315"
    ],
    "known_list": {
        "01:139901": { "alias" : "Dining Room"},
        "02:043392": { "alias" : "Controller"},
        "04:000868": { "alias" : "ccc's Room"},
        "04:001048": { "alias" : "Landing"},
        "04:143922": { "alias" : "Gym"},
        "04:143924": { "alias" : "Master Ensuite"},
        "04:143926": { "alias" : "Living Room Middle"},
        "04:143928": { "alias" : "Living Room Patio"},
        "04:227936": { "alias" : "_SPARE_FAULTY"},
        "04:227952": { "alias" : "Master Bedroom"},
        "04:227954": { "alias" : "bbb's Room"},
        "04:228032": { "alias" : "Unknown"},
        "04:228042": { "alias" : "aaa's Room"},
        "04:228044": { "alias" : "Front Room Bay"},
        "04:228048": { "alias" : "Office"},
        "04:228094": { "alias" : "Family Bathroom"},
        "04:228096": { "alias" : "aaa's BathRm"},
        "04:228104": { "alias" : "Kitchen Patio"},
        "07:033469": { "alias" : "DHW Wireless_OLD"},
        "07:043555": { "alias" : "DHW Wireless Sender"},
        "10:142568": { "alias" : "OpenTherm Bridge"},
        "13:230917": { "alias" : "Garage UFH Relay"},
        "13:102710": { "alias" : "Radiators Relay"},
        "13:133904": { "alias" : "DHW Relay"},
        "13:127198": { "alias" : "Boiler Relay"},
        "34:015243": { "alias" : "Living room"},
        "34:112193": { "alias" : "Kitchen UFH"},
        "34:214769": { "alias" : "Hallway"},
        "34:231315": { "alias" : "Garage UFH"},
        "18:000730": { "alias" : "evoGateway"}
    }
}
chris-hunter commented 1 year ago

Thanks I've tried your schema file and get the same problem. I wrote and extra log line into the evogateway.py file, and the problem seems to be that RAMSESRF_DISABLE_DISCOVERY is False. How is SZ_DISABLE_DISCOVERY set? It doesn't seem to be loaded from the config file.

smar000 commented 1 year ago

How is SZ_DISABLE_DISCOVERY set? It doesn't seem to be loaded from the config file.

Can you try changing the parameter in your config file to lower case, i.e. disable_discovery = False. The value of the constant SZ_DISABLE_DISCOVERY is coming from the ramses library, and is one of the changes that I included as part of the upgrade to the latest version of ramses.

chris-hunter commented 1 year ago

Putting disable_discovery = False in my config file didn't work. However, changing line 157 in evogateway.py RAMSESRF_DISABLE_DISCOVERY so fallback=True did work, so it is now running using my devices.json and ramses_rf_schema.json files. If I delete these files it returns to eavesdrop mode and writes new devices and ramses_rf_schema files as it should.

I did come across a couple of other issues in the process: When evogateway.py runs in eavesdrop mode and writes its own ramses_rf_schema.json file, it includes a "packet.log" section. This creates an error which is resolved if you delete this section from the ramses_rf_schema.json file

Also, if the ramses_rf_schema.json file contains "appliance_control": null, this creates an error - it seems to need a value. I have an S-plan system so my boiler is turned on by my DHW relay or heating relay, so my "appliance_control" is null. This doesn't create an error if it is null in ramses_rf's equivalent config.json file.

Finally, in evogateway.py line 129 SCHEMA_FILE fallback=ramsesrf_schema.json - I think it should be rames_rf_schema.json

Thanks for all your help - great program.

smar000 commented 1 year ago

changing line 157 in evogateway.py RAMSESRF_DISABLE_DISCOVERY so fallback=True did wor

Thanks for tracing back to this. I'll keep it in mind next time I have a look at the code.

When evogateway.py runs in eavesdrop mode and writes its own ramses_rf_schema.json file, it includes a "packet.log" section. This creates an error which is resolved if you delete this section from the ramses_rf_schema.json file

This is again another of the changes to the schema in the underlying ramses library. Again, I'll keep it in mind for the next update.

Also, if the ramses_rf_schema.json file contains "appliance_control": null, this creates an error - it seems to need a value.

Ok, will have a look at this too for next time!

Finally, in evogateway.py line 129 SCHEMA_FILE fallback=ramsesrf_schema.json - I think it should be rames_rf_schema.json

It should work with either (caveat being of course that if the corresponding entry is in the config file, it should be the same), as it is just setting up the global SCHEMA constant, which is used for both saving a schema file on exit and reading a schema file on startup. But again, will add to next round of updates, unless it is still causing you problems?

chris-hunter commented 1 year ago

No - it’s working well, thanks. Above just mentioned in case they cause anyone else trouble.