Skip to main content
1-Visitor
August 8, 2016
Solved

Setproperty from mashup checkbox

  • August 8, 2016
  • 1 reply
  • 6490 views

Hello,

I am trying to set the property of a thing using a checkbox on a mashup.

1. I have put this widget on the mashup, making sure I select the "Dynamic" checkbox. I have also configured the data bindings so that the checkbox "state" is linked to SetProperties."machineON" <bool> on my thing.

2. I have tried doing the above and also ​using the event "Changed" on the checkbox to trigger the "SetProperties" service.


Neither of these seem to work, so when I change the sate of the checkbox and go to its property page, the thing properties do not seem to change.

Best answer by Aanjan

Sorry, now I see the DynamicThings name there. Can you try adding the same MyHouse Thing again with the SetProperties and the widget bindings exactly the same way you have it now but without selecting dynamic when you're adding the SetProperties service?

1 reply

5-Regular Member
August 8, 2016

Kaloyan, you would definitely need to bind the 'Changed' event to the 'SetProperties' service to trigger it. Are you setting a Boolean value for the property as well?

kpashov1-VisitorAuthor
1-Visitor
August 9, 2016

Hello Aanjan,

I have now bound the "Changed" event to the DynamicThings_Thing.SetProperties and the State to the DynamicThings_Thing.SetProperties.MachineON

kpashov1-VisitorAuthor
1-Visitor
August 9, 2016

Hi Aanjan,

This did it, now that I haven't selected the "Dynamic" checkbox, it works exactly as expected. The AirConditionerOn property changes when I change the state of the checkbox. This is the final config that I am using to set the initial state of the checkbox, refresh it every time the data changes (in case someone turns the AC on or off) and finally to set it manually, should I need to do so.

Kind regards,

Kaloyan

The steps I have followed were:

1. Insert a checkbox on the mashup

2. Bind the state of the checkbox to the SetProperties.<Name of your property> (type Boolean)

3. Bind the event "Changed" to execute the SetProperties service

4. Bind any additional services to the state or the button as required by your UX

Final result

From the viewpoint of the Checkbox (I am loading the current state of the property at every refresh):