N
Sorry, posted the wrong link. Got me worried as I've just ordered another two of these switches. This is the correct link to the Smart Plug to switch the mains as well as showing consumption. Single pack:- https://www.aliexpress.com/item/1005008430296089.html Twin pack:- https://www.aliexpress.com/item/1005008584169841.html
N
hyamanieu: the first time I found out about Node-RED I thought "but why JavaScript?" (Like many, I know) Because it is the language of the web and node.js makes it easy to manage and run on servers or desktops, even Android and microprocessors at a pinch. How many people know erlang? Arguably, Python would have been a better foundation purely down to the number of people who learn it. But it is hard to beat the speed to delivery of a web microservice written in node.js
N
Well that particular one measures power consumption but it does not have a relay so no use for switching things on/off. I have a mixed bag of Gosund UP111, JulesV and Localbytes. China is very good at reselling the same thing under different names. The localbytes ones, a British company but surely manufactured in China, came with a Tasmota preinstalled, the older ones had to be flashed, but over wifi, no dismantling required.
N
So, as a temporary workaround, I've built this flow to use the admin API to install the local package: [{"id":"f1a0c0de03","type":"inject","z":"f1a0c0de01","name":"Install from folder","props":[{"p":"modulePath","v":"/src/node-red-contrib-uibuilder","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":120,"y":120,"wires":[["f1a0c0de04"]]},{"id":"f1a0c0de04","type":"function","z":"f1a0c0de01","name":"Build JSON request","func":"const modulePath = msg.modulePath;\nif…
N
I use these Tasmota-MQTT smart plugs for turning things on/off around the house/garage. https://www.aliexpress.com/item/1005009260021549.html I'm sure there is a version with an AU style socket.
N
I think Dave's is by far the most elegant suggestion: Plug the 12V PSU for the pump into a smart plug with Tasmota. Node-red mqtt sends power ON and OFF at the right times. (Or just send ON and use pulseTime in Tasmota to turn off after 5 minutes or whatever) No need for the Arduino, nor it's RTC or relays.
N
Trying_to_learn: The question I am asking is to do with the RTC drift. Originally the check time is/was 12:00 (mid day) But the time in the RTC has moved about 10 minutes fast. My weather polls still happen at/on the hour. Not 10 minutes before. I was wanting to .... tweak the time so it matches the active time rather than the "on the hour" one. It is a misnomer to think that RTC's retain absolutely the "correct" time. So I'm not surprised you are seeing drift, only that it has taken a while to…
N
hyamanieu: Industrial IT teams must be already aware of security risks and contain them at another level I'm afraid that, again from experience, I would say that isn't true at all. You've only got to look at the recent massive security failures to realise this. I'm not suggesting you need to fix these things yourself, but you should point out the issues. That way, at least nobody can later point the finger at you if there is a security failure. Lets not forget that, unlike most home automation…
N
hyamanieu: the take away message is that multiprocessing/threading should be my next target. Good. Having played around with Node-RED for the last few years, that is really my take away: it represents a way of programming in parallel (concurrently) that is simple and understandable. Its representation makes complex message passing architecture look like Dali paintings - far more understandable than reams and reams of textual code that is dotted with message sending and receive boiler-plate…
N
I'm impressed by the rust and Erlang versions of Node-RED. I must say, the first time I found out about Node-RED I thought "but why JavaScript?" (Like many, I know) Anyways, the take away message is that multiprocessing/threading should be my next target. I haven't checked how hard it is to install and use a no-GIL Python version, but with it multithreading would be enough. I would need to change my code anyways. Thanks!
N
Noice! Mine was a bit of a test bed to save me being eaten alive by the mosquitoes. I was going to have moisture sensors and all that, but it just became too complicated. (And getting the wires from the board to the pots.) The question I am asking is to do with the RTC drift. Originally the check time is/was 12:00 (mid day) But the time in the RTC has moved about 10 minutes fast. My weather polls still happen at/on the hour. Not 10 minutes before. I was wanting to .... tweak the time so it…
N
Might be time to re-think your setup and consider a newer microcontroller. For example, there are many controllers with built-in WiFi, ADC pins, I2C and some with loads of RAM and flash. Reading through your thread it seems the decision on whether to water or not is based on whether it is raining or will rain today. I built a Moisture Detector and Water Pump Controller as a project a year or so ago. The approach I took was to check the moisture content of up to four pots of herbs and if any…
N
This was in the back of my mind, but I thought it can be delayed: I wanted to focus on having a functional MVP first The issue is the same with exec or even function node (albeit not for executing code on remote machines, but that would involve the IT team) Industrial IT teams must be already aware of security risks and contain them at another level One idea was to use artifact keeper. With it, responsibility to let images or packages go through is delegated to another specialised team. IT and…
N
hyamanieu: What do you mean here? You have a link? I just ment that all two-way communication between Node-RED and all my Python scripts is with MQTT
N
Though not perfect, this is a schematic to show enough of how it works. (I hope) I'm old school and did it on paper.
N
The 12v is for this only. It was built to water the plants as I get eaten by mosquitoes. (We are kinda getting off topic) The pump is controlled by any of the 5 relays. Each of them (each? any?) control their solenoid. (12V DC about 1Amp needed) When that relays operates, the solenoid ..... opens, and the pump is turned on. After the prescribed time the next relay operates and the existing one releases. (less than 1 second switch over time) This repeats until all 5 relays have had their turn…
N
Ok so the 12v comes from somewhere. Probably a power brick to the mains ? Does it just drive the pump Or does the 12 v go other places that have to be on all the time ? If not then you could still control the power to the pump, and use a gpio on the arduino to detect the 12v being turned on ( via suitable isolation) and use that to trigger your sequence directly. Or indeed if the arduino is also powered up at same time then just start the sequence at that time
N
Good question. The pump is 12V DC. 3 Amps (there about) This was my early days of Arduino when they did 12V barrel jack inputs. I'm a 12V person. It is also a bit safer than playing with 240 VAC. And 5v doesn't quite do anything for a 12V solenoid. So the story is a bit more complicated than just ONE output. There are 5 pots to water. (Solenoids mentioned) So, each one has a different Run time (need for water). There are 5 relays (6 actually, but anyway) Each relay has 2 poles. DPDT if you…
N
Where is the pump getting power from ? If it’s mains powered why not just turn it on and off via the smart switch directly rather than use the arguing at all.
N
Well, yes I can. I just have to flash it a couple of times. Once to set the time to NOW and the second time to reload the program. I was more WORRIED about the times. As the trigger time is now time:50 for the plants to be watered, can I make the hourly weather check reflect that too? But I am sure it is just me being too OCD on it as I explained. In the bigger picture, it doesn't really matter anyway. Originally all things happened at time:00 not time:50
N
Trying_to_learn: The Arduino has 5 outputs that drive open collector transistors that switch 12V relays to switch 12V Solenoids and the 12V pump. The pump pulls about 3A. So I can't just connect it to an Arduino I/O pin. ... What I'd love it to have an arduino with Wifi. Then, I could control the Mains voltage with the smart plug, and call things to action with the WiFi. ... But I built it for 5V working and most of the new Arduinos are 3.3V. And they don't have the power ratings of the older…
N
For the fun of it: This is the dashboard Sorry it is not a nice fit. I need to zoom to that level so the buttons are correctly laid out.
N
(Going way off topic, but....) What I'd love it to have an arduino with Wifi. Then, I could control the Mains voltage with the smart plug, and call things to action with the WiFi. That would be great in that I would get better feedback from the device also. Confirmation power was applied (though academic) Times for each output being active. Time when all complete. Then it would turn the main power off. But that is a whole redesign as power levels and all that stuff. I built it for 5V working…
N
Well...... Not quite. jbudd: If there is a GPIO pin available which is always +5V while power is on, can you connect the water pump to that? You lost me. Where? On the smart plug? That's a sealed unit. I don't want to play with it. Being an Early Arduino it has a 12v barrel input. So I have a 5A 12V PSU. The Arduino has 5 outputs that drive open collector transistors that switch 12V relays to switch 12V Solenoids and the 12V pump. The pump pulls about 3A. So I can't just connect it to an…
N
Trying_to_learn: Clearer? Possibly. I guess that the smart plug switches mains voltage, while the Arduino provides 5V for the water pump. If there is a GPIO pin available which is always +5V while power is on, can you connect the water pump to that? Then the Arduino programming and RTC become irrelevant, you are just making use of the Arduino's power supply. The pump should run during the exact times when the Tasmota plug is ON. But I'm assuming that Node-red on your Pi has the right time and…
N
The Arduino is a very early UNO model. 5v I/O pins. The RTC is an addon board. I2C bus. Ok, to better explain: ORIGINALLY it was built as a stand alone unit - which it still kind of is. It has an RTC so it waters the plants daily at a given time. That as being built when I started in NR. It was completed, but I would daily turn the power on/off around 12 and off some times after it was done. That wasn't good. ITMT, I got into NR. After than I discovered Tasmota and it's Smart plugs (Yeah,…
N
What model Arduino are you using? Is the RTC built-in or an add-on board? When you fire up the power point (smart plug?), Tasmota almost certainly syncs it's clock with the internet so you could maybe use the Tasmota time?
N
Yes, I know there is an "easy" solution, but..... TLDR: I have an arduino - with RTC - to water my plants. There is no easy way to change the RTC time. (Stupid me) It triggers at mid day. Me, being anal, don't have it always powered. I use a Tasmota powerpoint and turn it on at 11:55 and off at 12:05 each day. This has a bonus feature that if it is raining, I can not turn it on and the day is skipped. That was a nice feature I got when I started playing with N-R. AND there is no "Summer time"…
N
TotallyInformation: But then, will we still care? Quite possibly, the quality of the bot responses by then may be so good, it won't matter! By then it'll just be a bunch of bots talking to each other on the forums. lol
N
I wouldn't bother, they are both not only depressing but startlingly close to reality now.