Warning Email to be sent once untill back to Normal value

Hi,
In my last setup I had an email warning that would be sent when cold water storage went over 22 degrees Celsius but didn't send any more until the temperature went below 22 and then over again, I have tried to import the flows that I exported as text in my first setup but I get a warning saying that it is not a json file, after doing a search on here for this, one guy used a filter that blocks the payload unless it is different, the problem with that is my temperatures have decimal places so that would still be a lot of messages, what would be the best way to do it ?

Thanks
Stuart

That should work. Select the nodes of interest and use the Menu Export to export it. Then use Menu Import to import it to the new system. If it won't import then post it here so we can take a look.

Hi Colin, I can no longer export anything from the old system as it is gone, before I wiped the sd card I exported the flows as text to a text file, however when I tried to import back into node-red it says that it is not a json file

Thanks
Stuart

The filter node has an option to block messages unless the payload changes by a certain amount (or percentage).

That might be a simple missed line at the start or end of the file.

A flow exported from Node-red is an array of objects. It should begin with an open square bracket and an open squiggly bracket character (on lines 1 and 2 if the export is "formatted" rather than "compact").
It should end with a closing squiggly bracket and closing square bracket.

If you look at the file in a text editor which shows matching brackets, the square brackets at the start and end should match.

[
{
   blah
}
 ...

{
   blah
}
]
1 Like

Hi Jbud,

I have had a look at the filter node but it wouldn't work as my temperatures have decimal places so every increment would send an email, I need a way of just been alerted by one email message until the temperature returns to normal and another message sent if it goes over again, I am going to have a look at the json file tonight, I saved the text in a Libra file on the old system and there is no what I call word Wrap on it, so when you open it the file is hard to read

Thanks
Stuart

Hi,
Well wow I have just repaired my very long file, I opened the text file in Notepad++ and saved it as a .json file instead of a .txt file, after that Notepad++ highlights everything that is a valid json file, and just where the colour changes you can see that a return/line change has been put in by the text editor, so it was a simple case of removing about 8 returns and saving, it then imports straight away into Node Red.

Thanks
Stuart

P.S. I have used Notepad++ for years it is an Excellent Free Tool

1 Like

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