One Ring To Rule Them All?

Sorry for the easy rip off of the Lord of the Rings... But it qualifies my question... Does someone have an elegant example of how to turn off a group of switches buttons when one of the group is turned on? In short, the given switch when turned on, forces the other switches to turn off?. This would mimic an inverse gang of switches.

Not quite the same, but I have a LightwaveRF remote that has a "group" switch. I use that to turn on/off a group of lights.

The trick for me is to disaggregate the controllers (inputs) from the plugs/switches/lights (outputs). Controllers send commands to MQTT. Outputs are controlled by Node-RED via listening to the MQTT commands from the controllers.

That way, you can map any controller switch to any (or many) outputs. It would be easy enough to invert some outputs so that 1 command output 1 on and several off.

There was a thread about this s few months ago if I remember correctly and between us we ended up with quite a neat flow. Whether anyone can find the right search terms to bring it up I don't know. I will have a look later if I have time, unless someone else finds it.

Yes I think a search on sprinkler would find it.

1 Like

Well remembered. Dashboard switches only 1 out of 4 at a time

Must admit I didn't look at it but careful use of link nodes can make it fairly clean.

[{"id":"2fe0e64d.5c1dfa","type":"inject","z":"756b4095.9a6c9","name":"On","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"1","payloadType":"num","x":130,"y":200,"wires":[["a2d810e7.798cf"]]},{"id":"a2d810e7.798cf","type":"trigger","z":"756b4095.9a6c9","name":"","op1":"0","op2":"","op1type":"num","op2type":"pay","duration":"10","extend":false,"units":"ms","reset":"","bytopic":"all","topic":"topic","outputs":2,"x":310,"y":200,"wires":[["79d66094.591d5"],["34399250.4ca85e"]]},{"id":"34399250.4ca85e","type":"debug","z":"756b4095.9a6c9","name":"Relay 1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":520,"y":220,"wires":[]},{"id":"79d66094.591d5","type":"link out","z":"756b4095.9a6c9","name":"Out 1","links":["f0cdda9e.be5a58","68fd05aa.5663ec"],"x":475,"y":180,"wires":[]},{"id":"78caeab6.5b86f4","type":"link in","z":"756b4095.9a6c9","name":"In 1","links":["59cbf845.8f3038","8c852db5.4a472"],"x":395,"y":240,"wires":[["34399250.4ca85e"]]}]

The cunning use of the trigger node ensures the off happens before the on and also splits the message into an on signal and off signal :slight_smile:

Cool, thanks guys... I found the published sprinkler flow, gave me quite a few different ideas. And in the forum I found the UI control someone did for sprinkler zones? I that gave me a few ideas for mine as well for the UI design.

Some time ago I wrote a sprinkler controller in Python, it works fine, driving a PCF8574 GPIO expansion to an 8 channel relay. I am now migrating same to NR. I had to build a PCF8574 control flow, since I could not find a working module, that is done works, can be driven by direct UI control or remote via MQTT. I just finished adding an irrigation flow with interface that drives the generic PCF8574 flow.

I think I spent more time tweaking the UI, than I did developing the entire Python based solution. LOL.
Of course now I need to establish a UI for irrigation schedule/queue. The fun continues!

UI's generally take up 80% of any development - that was true even back in the days of mainframes and paper reports :sunglasses: Unless, that is, you are working on analytical processing. That's a bit different.

Yeah, when HyperCard on the Macintosh was a big thing, new, I remember countless hours developing UI elements and related solutions. Now that seems so old school!

1 Like

One of my first jobs as a COBOL analyst/programmer was to amend a production report for Cadbury's. I began to think that I was useless when, after a week or so, I couldn't make any headway. So I involved a more senior programmer and neither of us could work out what was wrong and we involved the lead programmer. It took all 3 of us about a month to amend that print job it was so badly written. At least I learned very quickly why calculated goto's were a bad idea! :mage: Unbelievable how complex it was just to get a formatted print.

SOMEONE SAID THE 'C' WORD... Darleks have been put online and released! I aced by COBOL class, I think I got 99.5% on the final, I was missing 1 period. The instructor told me after the final... "Want to bet how many manhours it would take to find that one typo? If it was in the right place?" He was comptroller for NASA JPL... Just that JPL, Jet Propulsion Lab fame. He taught COBOL programming at my University for fun! His words. He was COBOL guru... and he told me he often had to spend insane time finding bugs in COBOL.

Haha, I'd still take COBOL over C/C++ any day :scream:

Of course, the really fun language was APL - required a math overlay keyboard and we referred to it as a "write-only" language (only slightly tongue in cheek).

Find all primes:


Come on... be a REAL programmer... ADA! LOL. I remember in late 1980s when ADA was going to be the glue that did everything... what in some ways Perl was moving towards, only for Python to IMHO trump all of them. Of course there was LISP... Now that was something that needed several cans of JOLT cola consumed, just to write a 'hello world' program in LISP.

Never did believe that ADA would take off. LISP was OK but certainly only worth it when combined with serious drugs (I imagine). My favourite hobby language was FORTH. Love that reverse polish notation!

FORTH? Oh, you are truly sick and evil... LOL! That is just about the ONLY language I did not have to spend real time with over the many years past. I think I had the most fun with LOGO... which we used to teach kids at summer computing camp (1985-1987) sound programming concepts. We would re-enact the programming homework with a 'human' turtle in a big classroom. The kids would write kinds of crazy programs just to see 'me' try to mimic the code commands. Even as I write this, I can hear the laughter, when some kid would program the turtle to crash into something. Ouch.

Logo was a toy :smiling_imp:

FORTH really helped me learn how to squeeze the very most out of limited platforms. It produces tiny programs that are very efficient.

True, LOGO was a toy... But that was what it was designed to be. I think the only environment I learned to hate was straight assembler. I think most because I just could not see that rationale of using it, when there were so many easier options. But I did end up doing some realistic assembler on PDP series DEC systems before the VAX generation was popular, dominated. Oh the joys of doing base 8 math. Ever look at what NASA did for Apollo mission? Talk about tight code in limited resource environment!

Oddest thing I saw, did not work on, but had friends that did, was programming for FAA, what was stored on steel wire spools. Had friend that worked ancient FAAA stuff, and showed it to me. Crazy stuff. Only other use of steel spool media I recall was Disney used it for the various animatronics programming for a while.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.