Hello all!
I'm looking for some advice, I'd like to use a single input on a Pi to cycle through 3 states of a selector eg:
off>0n1>on2>off>on1>on2......and so on.
Any ideas on how I can do it?
Cheers,
Fraser
3 way selector controlled by single push button?
Moderators: leecollings, remb0
-
- Posts: 17
- Joined: Thursday 10 November 2016 0:17
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
- Egregius
- Posts: 2592
- Joined: Thursday 09 April 2015 12:19
- Target OS: Linux
- Domoticz version: v2024.7
- Location: Beitem, BE
- Contact:
Re: 3 way selector controlled by single push button?
Simple, somthing like:
Code: Select all
if($s['switch'=="Off") sw($i['switch'],'On1');
elseif($s['switch'=="On1") sw($i['switch'],'On2');
elseif($s['switch'=="On2") sw($i['switch'],'Off');
-
- Posts: 17
- Joined: Thursday 10 November 2016 0:17
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: 3 way selector controlled by single push button?
Any chance you could help me by showing how I could do it in Blocky, using an input on the Pi called Button 3?if($s['switch'=="Off") sw($i['switch'],'On1');
elseif($s['switch'=="On1") sw($i['switch'],'On2');
elseif($s['switch'=="On2") sw($i['switch'],'Off');
Sorry for my complete lack of knowledge here!
-
- Posts: 17
- Joined: Thursday 10 November 2016 0:17
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: 3 way selector controlled by single push button?
When I push button 3, test tank light always goes to "off"
http://www.domoticz.com/forum/download/ ... ew&id=8372
http://www.domoticz.com/forum/download/ ... ew&id=8372
- Attachments
-
- Blocky.PNG (31.69 KiB) Viewed 717 times
Who is online
Users browsing this forum: No registered users and 1 guest