Nice! Looks good. It seems so simple at first, but it took me ages to get this working in the PiConsole as well. I’ve had it running in my development version for the last week or so, and haven’t noticed anything weird yet.
Thank you Peter and thank you for pointing out the title. I did that same error with a search and replace. Geez, Sometimes I wonder why my fingers don’t pay attention.
I have one formula working well and have therozied a second… I will test it out tomorrow and see which one is simpler. The formula is not as complicated as the issue. Funny how that works. I remember math being a lot easier 45 years ago. I had to work with pencil and paper then. Not sure how I survived.
Ah yes I see there are some cases that will have a strange result like the 333 to 320.
I guess it moved all the way around to the right didn’t it?
I think there needs to be checks for that delta and then determine which way to go.
I knew there were going to be a few other cases to deal and had to stop…
I have a compass application for work that had similar issues- will review how I did things for that.
Wouldn’t it be a good idea to keep a hint to weatherflow in the name… like
wfswsarchiver or archive4WFsws?
Just an idea for easy identification for us and especially those running m9re services on one system…
Here is my method used to move a compass indicator in another application.
I did change some of my variable names to more closely match the topic but logic did not change.
Very similar to your new and improved approach.
I ran a comparison of both approaches and they are a match!
Will not post the comparison stuff unless someone wants to see more…
private double GetWDChange(double? value, double previousWD)
{
double min = 0;
double max = 0;
double adjustedWD = value.GetValueOrDefault();
if (previousWD < 180)
{
min = previousWD;
max = min + 180;
}
else
{
min = previousWD - 180;
max = previousWD;
}
if (value > min && value <= max)
{
adjustedWD = value.GetValueOrDefault() + 360;
}
else
{
adjustedWD = value.GetValueOrDefault() - 360;
}
return adjustedWD;
}
checked the logs tonight (didn’t do any update manually since last night cron)
alert.err
at /home/eric/wfarchive/alert.js:134:114
at ClientRequest.<anonymous> (/home/eric/wfarchive/node_modules/pushover-notifications/lib/pushover.js:180:7)
at emitOne (events.js:116:13)
at ClientRequest.emit (events.js:211:7)
at TLSSocket.socketErrorListener (_http_client.js:387:9)
at emitOne (events.js:116:13)
at TLSSocket.emit (events.js:211:7)
at emitErrorNT (internal/streams/destroy.js:66:8)
at args.(anonymous function) (/usr/lib/node_modules/pm2/node_modules/event-loop-inspector/index.js:133:29)
at _combinedTickCallback (internal/process/next_tick.js:139:11)
ReferenceError: remaining is not defined
at /home/eric/wfarchive/alert.js:134:114
at ClientRequest.<anonymous> (/home/eric/wfarchive/node_modules/pushover-notifications/lib/pushover.js:180:7)
at emitOne (events.js:116:13)
at ClientRequest.emit (events.js:211:7)
at TLSSocket.socketErrorListener (_http_client.js:387:9)
at emitOne (events.js:116:13)
at TLSSocket.emit (events.js:211:7)
at emitErrorNT (internal/streams/destroy.js:66:8)
at args.(anonymous function) (/usr/lib/node_modules/pm2/node_modules/event-loop-inspector/index.js:133:29)
at _combinedTickCallback (internal/process/next_tick.js:139:11)
That is an easy fix. There was an error connecting to Pushover. When it went to report the error, there is an actual error in the reporting. I have just fixed it and uploaded a new file.
A new version with many updated files is ready. You will need to run updatefiles (twice) then run altertables.
When that is completed, you may run updatefiles again to get the new version. Restart the updated processes and check each Tab in the Server to ensure the proper data is present.
No errors in the logs, But… (There is always a but isn’t there…)
In the “solar” cell, the first light - last light and total light don’t update until I refresh / start a new device.
We have a cool new flashing red date and time? alert maybe? I’m only running “Server, Panel and Archive”
so I don’t have a clue what that is. Not a criticism, I love your program!
Chuck
P.S. I’m in Ohio and starting to get cold and snow, might be related.