Help for alternate "Dawn" signal

I'm a morning person. It is summer here.

But as summer comes to an end, the sun is getting later and later rising in the mornings.

As is I use BigTimer to signal Dawn / Dusk.

The Dawn signal is used to brighten displays.

But as it is apparent that soon I will be beating the sun to get up, I would like to have an alternate Dawn signal.

I'm not sure BigTimer can do this.
As is, it sends its signals at Dawn and Dusk.

I need to have it so: say, I get the normal Dawn/Dusk signals, I get a Dawn signal daily at 06:30 anyway.
Maybe it would be/could be ignored if Dawn has already happened, but for future days when sunrise won't be until 06:30+ I'd like things to get going at 06:30 all the same.

Thoughts / suggestions?

I do have chron+ available if needed.
But am stuck how to set it up so it is only (again: say) March - October. Seems silly having it all 12 months when 6 of them are not a problem.

You can apply offsets to both bigtimer and CRON+ so you set up two nodes instead of 1 (or just two entries in a single CRON+). Each with an appropriate offset. Also take a look at some of the other astronomical effects as Dawn/Dusk, Sunrise/Sunset, etc not always the best to chose. I tend to use the golden hours for example.

CRON+ has quite a few astronomic events

image

I quite like the default output that CRON+ gives as well. Here it is for the last event from my "daylight" MQTT topic:

{
    "triggerTimestamp": 1612800638562,
    "status": {
        "type": "static",
        "modified": false,
        "isRunning": true,
        "count": 1,
        "limit": 0,
        "nextDescription": "morningGoldenHourEnd in 16 hours 19 minutes 34 seconds",
        "nextDate": "2021-02-09T08:30:13.326Z",
        "nextDateTZ": "09 Feb 2021, 08:30:13 GMT",
        "timeZone": "Europe/London",
        "serverTime": "2021-02-08T16:10:38.579Z",
        "serverTimeZone": "Europe/London",
        "description": "Solar Events: 'morningGoldenHourEnd, eveningGoldenHourStart'",
        "solarState": {
            "state": "Day",
            "direction": "fall",
            "day": true,
            "night": false,
            "astrologicalTwilight": false,
            "nauticalTwilight": false,
            "civilTwilight": false,
            "goldenHour": true,
            "twilight": false,
            "morningTwilight": false,
            "eveningTwilight": false,
            "dawn": false,
            "dusk": false,
            "morningGoldenHour": false,
            "eveningGoldenHour": true
        },
        "solarTimes": [
            {
                "event": "morningGoldenHourEnd",
                "time": "2021-02-09T08:30:13.326Z",
                "timeOffset": "2021-02-09T08:30:13.326Z"
            },
            {
                "event": "eveningGoldenHourStart",
                "time": "2021-02-09T16:12:56.376Z",
                "timeOffset": "2021-02-09T16:12:56.376Z"
            }
        ],
        "solarEvent": "eveningGoldenHourStart"
    },
    "config": {
        "topic": "HOME/daylight",
        "name": "Daylight On",
        "payloadType": "default",
        "payload": "payload",
        "limit": null,
        "expressionType": "solar",
        "solarType": "selected",
        "solarEvents": "morningGoldenHourEnd,eveningGoldenHourStart",
        "location": "53, -1",
        "offset": "0"
    }
}

not 100% certain i fully understand your requirement but maybe this is close? (or gives you an idea)

cron fires every 06:30 and lets you know if dawn is true or false

[{"id":"cf0ef17f.d61f","type":"change","z":"553814a2.1248ec","name":"query solar state","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"command\":\"describe\",\"topic\":\"solar\",\"expressionType\":\"solar\",\"time\":\"2020-03-22 18:40\",\"location\":\"-27.468046394749486 513.0268478393555\",\"solarType\":\"all\"}","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":1210,"y":780,"wires":[["173eeb5a.b24145"]]},{"id":"173eeb5a.b24145","type":"cronplus","z":"553814a2.1248ec","name":"at 06:30","outputField":"payload","timeZone":"","persistDynamic":false,"commandResponseMsgOutput":"output2","outputs":2,"options":[{"name":"schedule1","topic":"06:30","payloadType":"default","payload":"","expressionType":"cron","expression":"0 30 6 * * ? *","location":"","offset":"0","solarType":"all","solarEvents":"sunrise,sunset"}],"x":1210,"y":840,"wires":[["cf0ef17f.d61f"],["d881ad51.5c291"]]},{"id":"d881ad51.5c291","type":"switch","z":"553814a2.1248ec","name":"Is Dawn?","property":"payload.result.solarState.dawn","propertyType":"msg","rules":[{"t":"true"},{"t":"false"}],"checkall":"true","repair":false,"outputs":2,"x":1420,"y":840,"wires":[["7a655289.9d045c"],["505b9806.1edc48"]]},{"id":"7a655289.9d045c","type":"debug","z":"553814a2.1248ec","name":"06:30 and dawn has passed","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1640,"y":820,"wires":[]},{"id":"505b9806.1edc48","type":"debug","z":"553814a2.1248ec","name":"06:30 and its not dawn","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1620,"y":860,"wires":[]}]

Thanks both of you.

Ok, attempt 2 to explain.

In summer I get up about 06:30 and sunrise / Dawn / (what ever) has happened.
The devices using it for their trigger (bad choice of words maybe in this case) has happened and they are happily glowing away.

Before that they are dark as...... Who needs displays to display at night when I am asleep?

That is all well and good in summer. But as winter is arriving, the trigger time is getting later and later, and some mornings I am up before the event and things are still dark.

Not a big deal, but if I want to know what time it is and the clock is still in "night node": it isn't going to happen.

So I was thinking that I'll leave the status quo as it but have an extra bit of code so that if the dawn signal isn't received by - say 06:30 - one is generated.

Clearer?

@Steve-Mcl Just looking at your flow.

{
    "command": "describe",
    "topic": "solar",
    "expressionType": "solar",
    "time": "2020-03-22 18:40",
    "location": "-27.468046394749486 513.0268478393555",
    "solarType": "all"
}

Location.

-27 - got it.
513!!??

(Sarcasm on)
What planet do you live on?
(sarcasm off)
:wink:

Cant you just use an inject node, set to fire at 6.30am in parallel with the timer node.

1 Like

This is why I have 2 measures. One for Daylight (true or false) and one for sleep (On or Off, probably should be true/false but On/Off fits in with my other settings).

I also have "threshold" settings for some locations - the landing and read hall for example that don't get much daylight.

I will only use the threshold we are not in "sleep" time. But my other timers are generally only either a fixed time or adjusted for the golden hours +/- some adjustment depending on where they are in relation to getting some natural daylight.

Obvious. KISS. (Might need an RBE as well)

1 Like

Yeah, but that's the easy way. :wink:

I have a tendency to make simple things harder than they need to be.

Also, say the inject node beats the other one for dawn.
The other dawn signal needs to be muted.

Then, when the other one beats the inject node's injection.... That message needs to be muted.

I always generate both daylight and sleep signals and then use those where needed for local lighting decisions based on details stored in a reference data table.

You really are over-complicating things I'm afraid.

Keep simple times simple and consistent. Just generate them always. But have >1 schedule, different ones for different times of year. Typically, you will want different schedules for DST/no DST. But depending on your latitude, you may need more. Close to the equator makes things easier than nearer the poles.

Yes, but if I take it to the ... extreme.... I simply make a signal daily at 06:30 for "Dawn" and all is good.

But I let it follow the seasonal trends of sunrise/set.

Then of an evening the brightness of the things controlled don't get dark too quickly in summer and do get dark quickly in winter.

Sunset is pretty fine as is.

Just I am now starting to beat "Dawn" for when I get up.

Things are getting put on more control of the system as time goes on.

So the question about having dawn track is ok, but just mornings are problematic because (soon) I will be up before dawn and am wanting things to be active.

The cron+ output is nice, but I'm at a loss to see how you can make a time (fixed) the turn on of a morning.

I fear I am not explaining myself clearly enough. (What else is new?)

Rethinking the question:
I want the "Dawn" signal to track/follow sunrise (dawn, golden hour... what ever, and with/without offsets.) but the latest time is 06:30 so in winter when it is 08:30 (kind of) things get started at 06:30.

If they start at 05:30 around the solstice all well and good.

Is that any clearer?

And so my "mute the second one" part comes into play because I don't want things to start happening at 06:30 when they receive the "dawn" signal then at 08:30 they get another one.
Or, they receive the real "dawn" signal at 05:30 from the node then at 06:30 from the newer node.

Madness will ensue. :wink:

Why? If you get a inject msg at 6.30am switching the lighting on, does it matter if you get another msg from the timer a little later. (2 'lights on' msg's).

Ah, if only it was that simple.

It isn't a "Turn the light ON" command.

It starts a sequence of slowly getting things going.

So things are started at the receipt of the signal.

Sending a second signal will start the sequence again.
Not desired.

You want BOTH signals, that is what I was trying to say. A fixed time is when you get up. The variable time is dawn (or golden hour or whatever works best).

If, when the wakeup signal fires, dawn has already fired then you don't turn the lights on.

How did I know you were going to say that :laughing: :laughing: :laughing:

1 Like

I'm dumb. I don't get that.

Especially the last bit.

At "Dawn" a signal is sent to start things happening. Clocks are turned on Clock displays are turned on (DIM) and slowly get brighter as time goes on.
And other things.

So if dawn happens before 06:30: When I get up things are bright. The sequence is well established and a few steps gone.
No big. It is light/bright because the sun is already up and shining. (Or should be)

In winter I get up at 06:30 and it is dark. I don't want things to be bright. I want them to be dim and get brighter as things time goes on.

So (yes, I can see that I am going to have to include a "morning's jobs done" flag in here somewhere) I don't want to get up in winter with the lights things getting brighter - and getting to full brightness - only to have them go back to dim at 08:30 when the sun officially rises.

Not if you use an RBE or a flag that you reset at, say, 2pm

1 Like

Here is a base line:

Screenshot from 2021-02-09 08-03-23

Be it from Bigtimer or cron+

I'm not going to split hairs on exact times. It is a trend which moves month to month.

In ... a few days (2 minutes a day I think is the change here) Sunrise ("Dawn"/what ever) is going to be after 06:30.

Recently I am waking up and getting up at or before the time here. So when I walk into other parts of the house, things are dark/off.
No big deal now. But in a few days time it will be annoying.

And again: Silly me.

Or when the sequence is complete (last message) I loop that and use it to reset the flag.

I don't think there would ever be more than 2 hours time difference between the two.

But maybe you are right. Pick a good time which is way out of the range and reset it that way.

@Steve-Mcl
So back to the change node you posted in the first (your first) reply.

{
    "command": "describe",
    "topic": "solar",
    "expressionType": "solar",
    "time": "2020-03-22 18:40",
    "location": "-27.468046394749486 513.0268478393555",
    "solarType": "all"
}

Time 18:40?

Is that just your local time because I am trying to understand what this does.

The cron+ node makes the pulse at 06:30. The other output is controlled by the change node.
I'd want it to send me a message at sunrise (dawn, what ever).
How does the code work?
And as I mentioned the lat/long are confusing in the location line.

Isn't that what @Steve-Mcl said?

Ok. Sorry. But that is how I read it. Kinda.