3 way selector controlled by single push button?

Topics (not sure which fora)
when not sure where to post, post here and mods will move it to right forum.

Moderators: leecollings, remb0

Post Reply
maninblack30
Posts: 17
Joined: Thursday 10 November 2016 0:17
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

3 way selector controlled by single push button?

Post by maninblack30 »

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
User avatar
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?

Post by Egregius »

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');
 
maninblack30
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?

Post by maninblack30 »

if($s['switch'=="Off") sw($i['switch'],'On1');
elseif($s['switch'=="On1") sw($i['switch'],'On2');
elseif($s['switch'=="On2") sw($i['switch'],'Off');
 
Any chance you could help me by showing how I could do it in Blocky, using an input on the Pi called Button 3?
Sorry for my complete lack of knowledge here!
maninblack30
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?

Post by maninblack30 »

When I push button 3, test tank light always goes to "off"


http://www.domoticz.com/forum/download/ ... ew&id=8372
Attachments
Blocky.PNG
Blocky.PNG (31.69 KiB) Viewed 717 times
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest