Closed Weissnix4711 closed 4 years ago
Your config looks right as written above. Are you sure that is what is actually in the file? Your error doesn't seem... possible even theoretically because its complaining about deserializing "id" which is expressly a string. It would only make sense on the "type" field being invalid, which it doesn't appear to be above.
The only thing I can think to check here is if any of your double quotes are actually higher order ASCII characters instead of proper double quotes and its throwing off the deserializer.
Yes, I copy pasted that directly from my file.
Also, I've now triple checked my JSON, by hand and against online JSON validators.
Nope, all quotes are normal. No specific right / left quotes or anything funky like that.
Could you send me your json, for me to check? Thanks.
Figured it out.
My JSON should be:
{
"mqttboiler/boiler": {
"id": "mqttboiler/boiler",
"type": "action.devices.types.SWITCH",
"willReportState": false,
"roomHint": "Living Room",
"name": {
"defaultNames": [],
"name": "Boiler",
"nicknames": []
},
"traits": [
{
"trait": "action.devices.traits.OnOff",
"attributes": {
"commandOnlyOnOff": true,
"queryOnlyOnOff": false
},
"commands": {
"action.devices.commands.OnOff": {
"on": "mqttboiler/boiler/set"
}
},
"state": {
"on": {
"topic": "mqttboiler/boiler",
"googleType": "bool",
"valueMap": null
}
}
}
]
}
}
I used your wiki page as a reference. You should be more clear that each device has to be it's own object, like in the example file.
The wiki is incorrect, the example file is correct.
Ah, no the Wiki is correct, but I thought you were only providing a single device from your JSON file, I did not realize you were providing the ENTIRE JSON file. The JSON file is essentially just a serialized copy of the internal state Dictionary, so yes, its key-value pairs of Id to Device object for quick lookups.
Sounds like you figured it out, Ill update the Wiki to try and be clearer about this.
After updating my config, I keep getting this crash.
My config:
(I am aware there is a boiler type, however this is just a test, and setting up a switch type is easiest right now)