I want to use a construction in my hometable like for example
local HT = { light1 = { fib_id = 211, hue_id = 7 },
light2 = { fib_id = 227, hue_id = 12 },
}
HT.ftoh = { [ HT.light1.fib_id ] = HT.light1.hue_id,
[ HT.light2.fib_id ] = HT.light2.hue_id,
}
When i test fibaro:debug( HT.ftoh[ 227 ] ) it gives the expected value 12.
I want to use this in a couple of VD's with ge
Which is kind of faulty.
It's a sparse array so a correct encoder should give an error like "invalid table: mixed or invalid key types"
Which the json encoder in scenes on the HC3 does, but not the json encoder in QA's on the HC3 (and not the HC2 scene version either)
If you don't get back what you encode when you decode it's not an encoder/decoder... it's something else.
It's possible to fool the json encoder on the HC2 too if you do a long sequential array 1,2,3,4,5...80 an