Ui-time-scheduler pre-select device from dropdown

Can anybody help me change ui-time-scheduler dashboard to be able to pre-select a required device ?

Similar to its enableDevice option that enables/disables the device.
And similar to the standard dropdown dashboard widget that accepts input number from msg.payload to preselect it.

I am displaying all the values in a table that has a callback click function.

Thanks

I am not sure this is what you mean, but here is an extract of something I have.

You will also need this file:
(plants.txt)

{"timers":[{"starttime":1606528500000,"days":[1,1,1,1,1,1,1],"output":"0","endtime":1606529100000},{"starttime":1616723700000,"days":[0,0,1,0,1,0,1],"output":"1","endtime":1616724300000}]}

Nodes:
You will have to edit the path to the file.

[{"id":"b5a97d4f.84ed58","type":"function","z":"6dd5ca4d.d1958c","name":"build message","func":"var path = global.get(\"event_paths\");\nmsg.filename = path + \"plants.txt\";\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":880,"y":4680,"wires":[["82e4dfc5.1ba768"]]},{"id":"82e4dfc5.1ba768","type":"file in","z":"6dd5ca4d.d1958c","name":"Plants","filename":"","format":"utf8","chunk":false,"sendError":false,"encoding":"none","x":850,"y":4730,"wires":[["46e58700.dc6b38"]]},{"id":"46e58700.dc6b38","type":"ui_time_scheduler","z":"6dd5ca4d.d1958c","group":"c0eea23d.14fd5","name":"Plants","refresh":"60","devices":["Daily","Away"],"customPayload":false,"eventMode":false,"outputs":3,"order":11,"width":"6","height":"1","x":1040,"y":4730,"wires":[["39958344.67685c"],["4e17f8ac.78c5c8","8a49b79e.e2e9d"],["4e17f8ac.78c5c8","c133b660.f9987"]]},{"id":"c0eea23d.14fd5","type":"ui_group","name":"Automatic plant watering","tab":"e92ac76d.c24e7","order":12,"disp":true,"width":"6","collapse":false},{"id":"e92ac76d.c24e7","type":"ui_tab","name":"Real_World_Control","icon":"dashboard","order":14,"disabled":false,"hidden":false}]

Oh. Thats not really what i mean. you are selecting different schedule time files for it right ?

I would like to do the selection of the dropdown of ui-time-scheduler (the place where it displays 'Overview') from an outside function.
Something like msg.select = id sent to it

This is possible on the standard dropdown widget of the ui-dashboard, but i would like it to work on ui-time-scheduler as well..

any ideea how to make this happen ?

In that example, yes. But that is an example.

Once, loaded you can change the schedule from the drop down list.
So rather than select overview select daily and that is what you will see.

Does that help?
(Sorry if I am not good just now. I have a few problems at my end just now too)

yes. I know how to use it. I am just trying to trigger the selection of 'daily' in your case from an external button.
I have other places that display data about each item, and it would be nice if the time scheduler widget updates all at once.

Nobody can help ?
thanks

(Sorry, been busy with other stuff.)

So you want to select (in the example I posted) daily from an input to it?

I don't think that is possible.

The input to the node is a schedule.
The output is determined on the schedule and what time it is now.

You may need to ask the person who made the node.
Or: this isn't the node for the job you are wanting to do.

Could you elaborate a bit more on what you want to do?

No promises of an answer though. Sorry. :wink:

exactly, the node needs a tweak to make this happen.
I couldnt figure out how to do it yet :wink: i asked him, no reply yet

I posted something which I thought was going to work, but I realised it wouldn't. So I deleted it.

It isn't anything else. Sorry.

yep. there is some angular js trickery needed here

I am thinking you may do better with a different node.

cron-plus may do what you want easier. Not sure. Just putting it out there

I figured it out how to add this feature to the scheduler :slight_smile:

Care to share? Seems I may be needing it too.

sure

Um, but.....

Where does that code go?

Is it a flow, or code for a function node?

change the file in .node-red/node_modules/node-red-contrib-ui-time-scheduler and restart nodered

there are a couple there..... .js or the .html one?

js
just the same filename i sent you

Sorry. Having a bad day understanding things.

you then send the node msg.selectdevice=0 to it to select the first device
or "overview" to get back to the default summary

Can I use an inject node and is that a 0 or O?

I tried with
[{"id":"01213c2ee34b5b8c","type":"inject","z":"65c9b63cb09879a0","name":"","props":[{"p":"selectdevice","v":"0","vt":"num"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":1440,"y":640,"wires":[["46e58700.dc6b38"]]}]
Doesn't work.