Setting states after reboot

Discussions about RaZberry - Z-Wave board for Raspberry computer
Post Reply
Posts: 63
Joined: 03 Jan 2015 00:10

Setting states after reboot

Post by timb » 23 Nov 2019 16:31

I wonder if anyone can help me...

I have been using Zway for a few years now. I use the Dummy Device frequently to represent a state, e.g. dd_DarkOutside, dd_SomeoneIntheHouse.
But I have also found them useful to represent virtual devices that mirror physical devices. So for example I have one for each of the various swicthes that control my heating system. I use the Rules logic to control the dd_device and the Association app to connect the virtual and physical devices. The reason for doing this is that if a physical device fails (and they do from time to time), then the physcical device can be replaced and I only have to change the Association to the new device. I don't have to look for all the places it might have been in Rules and Scenes.

There is another reason too. Sometimes I find that a Rule has triggered a change of swicth state, but for whatever reason the switch has not responded (frustrating!). This can be really bad - I could leave my heating on all day when the rule was supposed to turn it off. My solutoin is to use the AOn_Clock and Automated Swicth Off app to toggle a dd_device that I call dd_clock. Basically my dd_clock toggles every minute. Now I can create a rule that says:
if dd_device <> physical_device & ddclock then set physical device appropriately. Essentially this is a retry mechanism, which tries every minute to align the physcial and dummy devices. It works well.

By the way, add dd_clock to a Rule that is sensing a variable, like Temperature and it will try the rule everytime the clock changes.

Anyway, the question is this.... is there a way for me to run a start up script to set the state of the dummy devices when ever the Pi is restarted?

Many thanks for any help.

User avatar
Posts: 5286
Joined: 26 Jan 2011 19:36

Re: Setting states after reboot

Post by PoltoS » 02 Dec 2019 03:34


There is a Custom JS Code, but it can run before your Dummies are created, so put a setTimeout inside to let the code finally boot. Or trap the core.start (fired from main.js) event to execute your code.

Post Reply