Skip to main content
1-Visitor
October 12, 2017
Solved

How to get parameter value from embedded thing?

  • October 12, 2017
  • 1 reply
  • 1975 views

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.

Best answer by bmitioglov

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.

1 reply

1-Visitor
October 12, 2017

Tried also:

result = Things[me.FireSensor1.GetIdentifier()].value

Result:

TypeError: Cannot find function GetIdentifier in object FireSensor-1. (testGetValueFromSensor#9)

bmitioglov1-VisitorAuthorAnswer
1-Visitor
October 12, 2017

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.