(Last Updated: May 31, 2020)

Manually created device controls do not update variables



  • When I manually create a device, the device variables do not update when I manipulate the controls of the created device. I have tried both creating the device through Altui and through luup.create_device. I have tried both a dimmable light and a binary light. Both show up correctly after a luup reload but if I manipulate them to turn on, change dim, etc. the variables never update to reflect the change. For a created binary light device number 226, when I turn it on, the logs show

    2020-05-31 12:14:03.747   openLuup.server:: GET /data_request?id=action&output_format=json&DeviceNum=226&serviceId=urn:upnp-org:serviceId:SwitchPower1&action=SetTarget&newTargetValue=1 HTTP/1.1 tcp{client}: 0x3171c40
    2020-05-31 12:14:03.751   luup.call_action:: 226.urn:upnp-org:serviceId:SwitchPower1.SetTarget 
    2020-05-31 12:14:03.752   openLuup.server:: request completed (24 bytes, 1 chunks, 3 ms) tcp{client}: 0x3171c40
    

    Not sure what is going on here. Anyone have any ideas?

    I am running openluup v20.5.22 and altui v2.49.2547



  • What are you actually expecting? Is this a dummy device? If it has no implementation, then it will do nothing... or am I totally misunderstanding?



  • Yes a dummy device. I would expect if I turned the switch on then the variable 'Status' would change to 1 and if I turn it off Status would change to 0. I guess maybe I miss understand and because it is not actually associated with any physical device then Status does not change.



  • @kfxo said in Manually created device controls do not update variables:

    because it is not actually associated with any physical device then Status does not change.

    Absolutely correct. If you need something better then there are several plugins which may be useful...

    Switchboard, for one (available from the Alt App Store, so just one click away!)



  • @akbooer Ok. I got it. I was able to use the implementation file here to get the switch to function as I expected.


Log in to reply