SOLVED. Is there a way to force set @Device reference to a device of my choosing?

Is there any way of making sure @Device references a specific device without using DeviceBrowser?

I have a page of miscellaneous settings for the heating and on that page are a number of parameters for different devices. Some of them have times and/or lists of zones to configure. Ideally I want to push a page that has time edit ability and another than cherry picks a list of zones. The time editor and zone cherry picker exist but both work usng @Device.xxx parameters so need to know which device I want them to edit. I want to force set @Device before I push the editor page.

The only way around it I have at the moment is rather messy, using a device group containing the items with some heavily customised templates that edit just the zone list and times.

Page browsers use @device as well take a look at my tutorial.

Thanks
I haven’t used page browser before and it looks very useful. (Also you have produced a very good visual experience from it, Very impressed - I need to work on that aspect!)

Going back one step to where you set the device to either TV - - I am trying something similar but when I jump to the editor page - the device is not correctly set. Could you share your hrp file so I can pick through to find where I am going wrong?

Coppo

hrp attached

Page_Browser_Demo.hrp (2.8 MB)

Ok. I have gone sideways and created a mini version of pagebrowser - following as best I can, what you have done in your tutorial.
In my test button there is two actions - set Device to one of my room devices and then push the page.

The push works as expected and the Device browser shows the expected page - albeit without data filled in. As soon as I add the set Device property it fails quietly. If set Device is in front of the push property - as you would expect, the push does not work either, making me think I am not correctly referencing the Device property in the device browser. TargetName is set to the name I gave the browser. Hope the following clip explains.

Ok. Found why its not working but not how to get around it. The device browser is on a different page to the button. The property ‘Device’ on the browser is not available at the moment the button is clicked. I have tried delays in the button actions but the step that sets the property in the device browser page always fails to run unless I create and use a button on the same page as the browser.

I need to know what to put in ‘TargetName’ to set a property in ‘apcbrowser’ on another page.

How do I get around this?
Thanks

You may be able to get around it by implementing a virtual device. See the following thread.

Thankyou. This workaround idea is successful.

As suggested, I set a virtual device variable to the device name in the button event click and then in the ‘loaded’ action of the pagebrowser set the browser ‘Device’ property to the content of the virtual variable.

1 Like