The given key was not present in dictionary

I copied a device manually and changed the ID to one which exists in HC3 (a switch to a switch) and when I bind it to a button or a toggle I get the error message “The given key was not present in dictionary”. What does that mean?
BTW, is there a log with the simulator where I get more insights (e.g. what command was sent to the Home Center?)

BTW: the device reads like this in the api:
{“id”:785,“name”:“thr_GoodNight”,“roomID”:219,“view”:[{“assetsPath”:"/dynamic-plugins/com.fibaro.binarySwitch/assets",“jsPath”:"/dynamic-plugins/com.fibaro.binarySwitch",“name”:“com.fibaro.binarySwitch”,“translatesPath”:"/dynamic-plugins/com.fibaro.binarySwitch/i18n",“type”:“ts”},{“type”:“json”}],“type”:“com.fibaro.binarySwitch”,“baseType”:“”,“enabled”:true,“visible”:true,“isPlugin”:true,“parentId”:0,“viewXml”:true,“configXml”:false,“interfaces”:[“light”,“quickApp”],“properties”:{“apiVersion”:“1.1”,“categories”:[“lights”],“dead”:false,“deadReason”:"",“deviceControlType”:2,“deviceIcon”:2,“emailNotificationID”:0,“emailNotificationType”:0,“isLight”:true,“log”:"",“logTemp”:"",“mainFunction”:"-- Binary switch type should handle actions turnOn, turnOff\n-- To update binary switch state, update property “value” with boolean\nfunction QuickApp:turnOn()\n self:debug(“binary switch turned on”)\n self:updateProperty(“value”, true)\n, “test”)\n self:turnOff()\nend\n\nfunction QuickApp:turnOff()\n self:debug(“binary switch turned off”)\n self:updateProperty(“value”, false) \nend\n\n-- To update controls you can use method self:updateView(, , ). Eg: \n-- self:updateView(“slider”, “value”, “55”) \n-- self:updateView(“button1”, “text”, “MUTE”) \n-- self:updateView(“label”, “text”, “TURNED ON”) \n\n-- This is QuickApp inital method. It is called right after your QuickApp starts (after each save or on gateway startup). \n-- Here you can set some default values, setup http connection or get QuickApp variables.\n-- To learn more, please visit: \n-- *\n-- *\n\nfunction QuickApp:onInit()\n self:debug(“onInit”)\nend\n",“manufacturer”:"",“model”:"",“pushNotificationID”:0,“pushNotificationType”:0,“quickAppVariables”:[],“saveLogs”:true,“smsNotificationID”:0,“smsNotificationType”:0,“state”:false,“typeTemplateInitialized”:true,“uiCallbacks”:[],“useEmbededView”:true,“userDescription”:"",“value”:false,“viewLayout”:{"$jason":{“body”:{“header”:{“style”:{“height”:“0”},“title”:“quickApp_device_785”},“sections”:{“items”:[]}},“head”:{“title”:“quickApp_device_785”}}}},“actions”:{“toggle”:0,“turnOff”:0,“turnOn”:0},“created”:1591683746,“modified”:1591683746,“sortOrder”:312}

What is interesting (at least to me):
When I run (a physical switch) I get {“id”:0,“jsonrpc”:“2.0”,“result”:{“result”:0}} as a response
When I run on the virtual switch causing this error I get {“message”:“Accepted”}. The command gets executed but not from Home Remote even though the api seems to be the same

I don’t know that this error even has to do with Fibaro. Could simply be something in the XAML that got corrupted. Send me your HRP so I can take a look. Tell me if there are any special steps I have to take to recreate the error.

I just did. However, I tried a lot of options today but I failed as soon as I added the ID of a Quick App/Virtual Device. I am with you that this seems not to be a Fibaro problem but I do not have any logs or additional information to look into

There was something wrong with the upload. Can you please resend it?

When do you see this error?

That’s what I’m kind of confused about. When you bind a device in Design mode it shouldn’t be sending any device commands.

No, when I click on the button or switch in the Simulator. Sorry. I tried different setups there (copied different devices as a source) to no change.

Can you post a screenshot of what you see when you click the button in the simulator?

I’m trying to create the new 3.2.0 builds right now. Please if you could,

#1 - Show me exactly which button is generating the error.
#2 - Take a screenshot of the error.

That’s really all I need.

#3 - Have you tried the “admin” account? It’s clear from our “Scene” discussion that Fibaro needs the “admin” account to execute certain function. That could very well be the case here too.

Sorry 3 things I need.

Please if you could, answer these 3 questions as quickly as you can because if there is a bug I’d like to include a fix in the update I’m posting today. If you can’t get it to me quick enough it might have to wait a week or 2 until the next release.

Good catch: I briefly built a “new” app and tested the admin account and then it works. Seems to be a Fibaro problem then.
Will keep you posted. I opened a ticket (and now go to bed, I am in European time zone ;-))

1 Like

Cool. Sounds good. I’m going to proceed with the updates then. I can make any changes if needed once you here back from them.

But if I just change the account in my original app and try to run it, I get the same error… That’s really strange. Let me try again. Sorry

Well, to many tests during the day - my fault.
Summary is: If I use the account I want(ed) to use for the tablet, the QA does not work. If I use the admin, it does.
So all good on your side. Looking forward to the new version then with the scenes and I will work with Fibaro on the rest and keep you posted
Thank you for your support

1 Like