Advice for best approach please

#1

Guys,

I am in the process of convert my home heating and cooling system from an old system that was built on Picaxe chips and Basic programming into Arduino and MQTT (using Node-red of course !!)

Of course i have left this until Winter is almost upon us (in Australia) so the system needs to be operational whilst in transition.

I am gradually migrating functionality to the new system - ultimately all the main code will be in JS on Node-red and the Arduino will only perform I/O functions.

Part of the heating system enables the use of Solar to heat a water tank for hydronic heating, and this overrides the use of a boiler for the same purpose (so on a nice sunny day i prefer essentially free solar hot water for heating, than using a gas fired boiler)

This was all performed with convoluted logic that grew organically in the Picaxe system - i want this to get smarter in Node-red and intend to source external weather data in the longer term to establish whether i would get enough solar input on a given day to make it worthwhile rather than running the boiler.

Before i get to that level - i want a “manual” overide in Node-red - i can look out the window and see the weather for the day and then press a Node-red button that will inject an override code into a MQTT topic that the Arduino monitors.

I have all of that working - what i am looking for is a node that i can click on (call the node Manual Override - 4 hours) for instance, and this node will inject (say) a 1 into the MQTT topic, it will then countdown and after 4 hours will inject a 0 back into the same Topic to now put the system back into automatic mode.

ANyone know of a node i can use to do this ??

regards

Craig

0 Likes

#2

The trigger node can help do that…
(But the time delay is preset per node - so you would need several different buttons and triggers for different time periods if you did it this way)

0 Likes

#3

Just to make it a bit more explicit, the “click” node you’d want to use is the inject node going into your trigger node. Then as @dceejay highlighted you can set the trigger node to send the “1” and x hours later send the “0”. By setting up multiple pairs of these feeding into your mqtt topic you’d have your control dashboard for various time periods.

0 Likes

#4

excellent - thanks guys - will give it a go and report back

Craig

0 Likes

#5

Yep Winner Winner Chicken Dinner !!

That was exactly what i wanted thanks guys

Craig

0 Likes

#6

Hmm, OK playing with this now - is there anyway to track the progress of the countdown timer ? i.e. i tell it to inject a 1 initially and then after 240m to inject a 0 - is there someway to track how far along in the 240 minutes the countdown is ?

Craig

0 Likes

#7

Depends on where you want to track it and if you want a countdown timer or just one you can manually check?.

Easiest way is to add a debug node on the output of the countdown timer which would then give you a timestamp in the debug window and you could do the math in your head.

You could also use a function node to extract the time value at the initial trigger and store it in a global variable (or an mqtt topic if you wanted it in another system) and then use another node triggered by an inject node (either manual or repeating) to pull the variable value, calculate a diff and display it someplace (a debug node or maybe one of the dashboard nodes - haven’t played with them).

Just a couple of suggested approaches

0 Likes

#8

OK thanks for that - sounds like a bit of work and a distraction from what i am trying to achieve so will leave it for now - would have been a nice to have.

regards

Craig

0 Likes

#9

You should put it in as a sugestion in the Dev category to display time remaining on the trigger node.

0 Likes

#10

Good idea will do thanks - even as a debug option would be good

1 Like

#11

Just as a follow up here guys - scope creep happened and i wanted to get smarter about what i was doing. Moved to using Peter Scargills timeout node which was good - but not perfect for what i wanted. I then stumbled upon a fork of Peters work - Cherry - Mytimeout - which is perfect - accepts different inputs to modify behaviour and has two types of output.

Just need to work out now how to get the countdown onto my dashboard !

Craig

0 Likes