If statement with strings, time

Hello, first of all... i have 0.1% knowledge of node red.
for school I have to make an automated system that sends every morning on the time when the sun comes up an email trough IFTTT of the temperature from our nearest city. (openweathermap)

Right now I have a system that can send the temperature of the nearest city to my email trough IFTTT.
Now i am trying for 3 days straight to get the time from the sunrise to activate the system... but nothing works.
i found something to convert the sunrise to a string named msg.payload.sun
and i have the string of my local time msg.payload

Is it now possible the use a if functions when the 2 msg's are the same it triggers the system?

thx!

Hi there is no need to post code to external service, just paste it between backticks

```
like this
```

As for your issue, there are several nodes which can tell you when it is sunrise time e.g...
node-red-contrib-cron-plus

for sending emails there is node-red-node-email

NOTE: I dont use IFTTT (so cant help) - mostly due to the fact I can do pretty much everything i need to without it & the recent changes to their product.

2 Likes

Start by spending an hour watching the node-red essentials videos, it will be time well spent.

Openweathermap returns the sunrise as a timestamp in seconds, while JS and moment use milliseconds. You will need to multiple the returned sunrise timestamp by 1000.

wow.... that node just fixed everything thank you so much!!!!!!!!!

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