Closed fightforlife closed 4 years ago
I don't think that's your issue... I have plenty of devices in my setup with mixed casings. By chance did you accidentally catch a WHITESPACE character in the name?
Note, you can look at your googleDevices.json file to see what was captured in the name (and if its whitespace getting captured, then you can remove it there, restart, and you should be back to editable).
I just tried it again:
This is working: http://192.168.1.2:9035/GoogleDevice/Edit?deviceId=computer 200 - found
{
"computer": {
"id": "computer",
"type": "action.devices.types.OUTLET",
"disabled": false,
"willReportState": true,
"roomHint": "Wohnzimmer",
"name": {
"defaultNames": [],
"name": "Computer",
"nicknames": []
},
"deviceInfo": null,
"traits": [
{
"trait": "action.devices.traits.OnOff",
"attributes": null,
"commands": {
"action.devices.commands.OnOff": {
"on": "gateway/send/433"
}
},
"state": {
"on": {
"topic": "gateway/confirmation",
"googleType": "bool",
"valueMap": [
{
"mqtt": "1135889,300,1",
"type": "value",
"google": true
},
{
"mqtt": "1135892,300,1",
"type": "value",
"google": false
}
]
}
}
}
],
"customData": null
}
}
This is not working (capitel in id field): http://192.168.1.2:9035/GoogleDevice/Edit?deviceId=Computer 404 not found
{
"computer": {
"id": "Computer",
"type": "action.devices.types.OUTLET",
"disabled": false,
"willReportState": true,
"roomHint": "Wohnzimmer",
"name": {
"defaultNames": [],
"name": "Computer",
"nicknames": []
},
"deviceInfo": null,
"traits": [
{
"trait": "action.devices.traits.OnOff",
"attributes": null,
"commands": {
"action.devices.commands.OnOff": {
"on": "gateway/send/433"
}
},
"state": {
"on": {
"topic": "gateway/confirmation",
"googleType": "bool",
"valueMap": [
{
"mqtt": "1135889,300,1",
"type": "value",
"google": true
},
{
"mqtt": "1135892,300,1",
"type": "value",
"google": false
}
]
}
}
}
],
"customData": null
}
}
How did you get it into that state? The issue is that "id" and the actual key should always match.
I.e., should be:
{
"Computer": {
"id": "Computer",
ok THAT looks like a bug. I think when you change the id after initial creation, it updates the id but not the device repository key. Ill add a todo item for this.
In the mean time, you should be able to correct by editing the googleDevices.json, making them match again, and restarting the app.
It is also present at inital creation of a device:
Entering a device like this:
Results in this:
Which results in a 404 because the id is capital and and the key is not.
Ah. TWO issues. Ill have to consider this. THAT'S a serialization issue. Just don't start the device with a capital. Capitals anywhere else in the name will be kosher.
I just found a a little bug:
If the id of a googleDevice contains capital letters, it is not editable anymore after restarting Homeautio.
Maybe the Device "Id" field could check for capital letters or just add a small reminder.