Dear all,
someone could teach me on how to make my plug a bit more clever?
I would like to write my first code (js or php) to instruct my plug to turn off automatically when the power meausered by the plug itself is higher (or lower) than a threshold.
.. or after a certain time it is turned on.
Many thanks for your help.
Ciao
A clever switch
Re: A clever switch
zway.devices[N].Meter.data.val.bind(function() { if (this.level > X) zway.devices[N].SwitchBinary.Set(0) });
Check for correct dataholder name, scale S, device id N and value X.
Check for correct dataholder name, scale S, device id N and value X.
Re: A clever switch
Hi PoltoS,
please give me some more 'low level' details. I'm really a beginners.
Where I should write the code you suggested me? in which file?
Need to have few examples so that I could understand and personalise them.
For example I have installed a Micro Switch device to turn off the Television of my dauther that is usually leaving on it during the night.
To do that I wrote a small php script (switchoff.php)
and I have added this line on my crontab:
Now, starting from midnight till 4AM, the system switch off the tv every hour, in the hopeness that after 4 AM she is sleepping.
I'm sure this is not the clever way to use Z-Way. What would have been the right approach to do it?
Please send me some few detailed examples so I can learn by doing.
Ciao
please give me some more 'low level' details. I'm really a beginners.
Where I should write the code you suggested me? in which file?
Need to have few examples so that I could understand and personalise them.
For example I have installed a Micro Switch device to turn off the Television of my dauther that is usually leaving on it during the night.
To do that I wrote a small php script (switchoff.php)
Code: Select all
<?php
$result = file_get_contents('http://192.168.1.22:8083/ZAutomation/OpenRemote/SwitchBinaryOff/5/0');
?>
Code: Select all
0 0-04 * * * /usr/bin/php /var/www/123solar/scripts/switchoff.php
I'm sure this is not the clever way to use Z-Way. What would have been the right approach to do it?
Please send me some few detailed examples so I can learn by doing.
Ciao
Re: A clever switch
I cannot believe there is nobody availabe to support. Really the real scope of any forums is to support each other.
Re: A clever switch
does this works in your browser?
http://192.168.1.22:8083/ZAutomation/Op ... aryOff/5/0
does the script runs by cron (check cron logs)
http://192.168.1.22:8083/ZAutomation/Op ... aryOff/5/0
does the script runs by cron (check cron logs)
Re: A clever switch
Yes it woks very well but I wonder I'm not using all the potentialities of the Z-Way system. I'm sure I could do the same using some of the existing Modules or Rules. If you give me some examples I will start to study them.
Another problem I have is related to the status of the Aeolabs Micro Switch. When I open Expert UI I see the swith not updated and I need to push the button 'Update' on Device Control to update it.
Is there any special setting I should do?
Many Thanks again for you support
Another problem I have is related to the status of the Aeolabs Micro Switch. When I open Expert UI I see the swith not updated and I need to push the button 'Update' on Device Control to update it.
Is there any special setting I should do?
Many Thanks again for you support
Re: A clever switch
Associate it with Z-Way. But some switches forgets to report correct value in correct channel, so no way to fix it without a hack. We think on making a module to make the hack 
Currently we have no scheduler module to do what you want, but it is very easy to make based on BatteryPolling device. I've added it to our with list

Currently we have no scheduler module to do what you want, but it is very easy to make based on BatteryPolling device. I've added it to our with list
Re: A clever switch
Could you post any exampe of BatteryPolling?PoltoS wrote:Currently we have no scheduler module to do what you want, but it is very easy to make based on BatteryPolling device. I've added it to our with list
Re: A clever switch
It is located in z-way/automation/modules/BatteryPolling on your RaspPi
Since 29-12-2016 I am no longer a moderator for this forum