Ok, but where should I put the bypass, on the terminal of the staircase timer?
Or maybe it would be just better to wait for the Pro line and just put it as a momentary switch?
Beiträge von Belthazor
-
-
I wanted to add a shelly device so I can switch on the corridor lights in my building in certain scenes. We have on each floor several regular physical momentary switches with 2 wires and an indicator lamp. The lamp is on when the switch is not pressed and turns off while the switch is pressed. I wanted to add a shelly 1L in parallel with one of the switches. The live terminal would be connected to the live wire, and output to the output wire switch. Note that there is no neutral wire here. The relay would be on for 1 sec enough for the staircase timer to switch on the lights, simulating a press on the physical switch. Would this work? Or is there another way to do this? I think I could access the actual timer switch in the building and put either 1L or any other switch from Shelly, but the first method is more accessible.
Kind regards and thanks in advance for your answers
-
So I ended up writing a little applet in php which can, based on supplied parameters, do what I need.
So for example when I go out, I want to switch everything off on long press:
http://<serverip>/switch.php?type=all&relay=0
The script will then fetch current state of relay that sent the request and based on it's state will set the state of other switches.
I only added an exception, when I return home and longpress the switch, it will only turn the lights on, not everything else.
It's a little scrible of code, I did not have enought time to play with it more and add more features and some sort of AI
PHP
Alles anzeigen<?php $type='lights'; $relay=0; $ip=$_SERVER['REMOTE_ADDR']; $state = "off"; if (array_key_exists('relay', $_GET)){ $relay = $_GET['relay']; } if (array_key_exists('type',$_GET)){ $type=$_GET['type']; } $status=json_decode(file_get_contents("http://".$ip."/relay/".$relay."/status")); if($status->ison){ $state="on"; } call_user_func ($type, $state); function all($state){ if ($state=="off"){ wh($state); other($state); fans($state); } lights($state); } function wh($state){ $wh=array(array('ip'=>'192.168.1.17','relay'=>'0'), array('ip'=>'192.168.1.10','relay'=>'0') ); foreach ($wh as $device){ file_get_contents("http://".$device['ip']."/relay/".$device['relay']."?turn=".$state); } } function other($state){ $other=array(array('ip'=>'192.168.1.27','relay'=>0)); foreach ($other as $device){ file_get_contents("http://".$device['ip']."/relay/".$device['relay']."?turn=".$state); } } function lights($state){ $lights=array( array('ip'=>'192.168.1.7','relay'=>'0'), array('ip'=>'192.168.1.7','relay'=>'1'), array('ip'=>'192.168.1.13','relay'=>'0'), array('ip'=>'192.168.1.18','relay'=>'0'), array('ip'=>'192.168.1.21','relay'=>'0'), array('ip'=>'192.168.1.22','relay'=>'0'), array('ip'=>'192.168.1.25','relay'=>'0'), array('ip'=>'192.168.1.27','relay'=>'1') ); foreach ($lights as $device){ file_get_contents("http://".$device['ip']."/relay/".$device['relay']."?turn=".$state); } } function fans($state){ $fans=array(array('ip'=>'192.168.1.20','relay'=>'0'), array('ip'=>'192.168.1.21','relay'=>'1') ); foreach ($fans as $device){ file_get_contents("http://".$device['ip']."/relay/".$device['relay']."?turn=".$state); } }
-
Hi Michael,
Thanks for the answer.
I think that for now I will route this via my mini http server (which I use for development, so I wanted to try and avoid this). So on long press it will call http://192.168.1.3/switch.php and it will call all the switches via api to close all the relays.
Thanks for your assistance.
-
I recently installed multiple Shelly1 and 1PM for controlling various things in my appartment mostly by using momentary switch type, and I am very happy with them. However, I would like to add a functionality to one of my switches which is near apartment door and controlls lights in entryway. I want it to turn off all the shelly relays on long press. So for example when I or somebody else leaves the appartment, to switch everything off with one long press. I am aware of DDD and long press option, but there I can supply a URL to only 1 device. Is there a way to send multiple commands this way, or a way to do this via cloud? Now I already have google assistant connected, so I can also use that, but I wanted this just as a sort of backup, and for members of my family who are not quite fluent in english (so google assistant cant really understand them all the time).
Appreciate any sugestions