Probably a simple dictionary question - parsing nest dictionary

I am getting an error code while trying to parse a nested dictionary. I am testing this for some json functionality coming from a webserver.


I'm working on setting up some dynamic components. To me the error indicates a issue with the 2nd loop. Where the DEVICE[dictionary] = 0, I should be able to get the key[key] and the value[value].

I am not sure why it's saying the argument is not a "list", as the foreach clearly states to use a dictionary.......

got that figured out... I was using key instead of value.

use a Number as key of dictionary is not a good idea.