Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X
Hi guys,
I have a thing that have another several things as it's parameters with type: THINGNAME.
And I want to get values from those things in my service.
I tried to do (FireSensor1 has the number property called 'value'):
result = Things[me.FireSensor1].value
It is not working, the error is:
TypeError: Cannot read property "value" from null
Could you please explain how to do such things?
Thanks.
Solved! Go to Solution.
Sorry, It was my fault. I was saving the Thing template from which my thing was inherited and FireSensor1 property was clearing because of that, so I kept getting this null pointer exception.
result = Things[me.FireSensor1].value
This is working now.
Thanks.
Tried also:
result = Things[me.FireSensor1.GetIdentifier()].value
Result:
TypeError: Cannot find function GetIdentifier in object FireSensor-1. (testGetValueFromSensor#9)
Sorry, It was my fault. I was saving the Thing template from which my thing was inherited and FireSensor1 property was clearing because of that, so I kept getting this null pointer exception.
result = Things[me.FireSensor1].value
This is working now.
Thanks.