Giter VIP home page Giter VIP logo

node-red-contrib-light-scheduler's People

Contributors

davidevertuani avatar dependabot[bot] avatar erikalveflo avatar fredtprive avatar niklaswall avatar palmerabollo avatar wizbangcrash avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

node-red-contrib-light-scheduler's Issues

Dusk/Dawn vs Schedule, plus randomness

A couple of questions, perhaps can be clarified in the documentation, which I'm willing to do when clarified!

  • If I only care about dusk/dawn (e.g., exterior lighting), do I have to do anything other than select "only when dark"?

  • Or is this and, meaning "when scheduled" and "only when dark"? If I schedule all 24 hours, then I would get ON once dark, and OFF once light, correct? (subject to sun elevation, etc.)

  • If I have randomness in the above scenario, does it still apply to the ON and OFF times, or only the programmed start and stop times? For example, if I program start at 00:01 and end at 23:59, what is random? The ON and OFF, or the 00:01 and 23:59?

Thanks!

Temporary overrides, resetting on next schedule event

First, thanks for a superb node.

I have a scenario where I have a on/off switch that overrides the schedule, much like the motion detection example in the docs. However, I would like the override to disappear only after the next schedule event change. For example, if I override the schedule and turn the lights off when I go to bed with the switch, I want them to turn on the next evening again like normal. I think that this is how bigtimer works:

[...] you can override the setting during the day by sending “on” to the input. This override will reset at the next auto change of state.

I can see that the current override mechanism makes sense for some cases as well. Two reasonable ways of implementing this:

  • Add a config option to enable clearing overrides on schedule event
  • Add a new input that is a "temporary" override, e.g. temporary_on and temporary_off

What do you think? If you think it makes sense I'd be happy to write some code. What I hope for the most, though, is that I missed something and this is possible already.

What about different dusk/dawn thresholds?

What about different dusk/dawn thresholds?

You could add different thresholds for dusk and dawn to compensate for rooms having early or late sun.

So you could compensate a room which is dark in the morning but lit by the sun in the evening.

Suggestion: Multiple outputs

This is a nice node!

I would like to have multiple outputs, similar to Bigtimer. That would mean that I could wire both "when state changes" and "minutes" from the same node in the same flow.

For example, the same node/schedule will control the reliable z-way-light and the unreliable 433MHz-light (that needs every minute).

And outputstring for logging are also nice.

Schedule carrying over to next day turns off then on

Hi, first of all, thanks for the great project!

I have light schedule everyday from 17:00 to 1:00 with 5 min randomness.
But this will cause a turn off and then on at 0:00 (2 min here):

image

Is there anyway to avoid this from happening?

Thanks

Time zone problems with docker? Read this

tl;dr: Does your docker-compose.yml file contain?

volumes:
  - /etc/localtime:/etc/localtime:ro
  - /etc/timezone:/etc/timezone:ro
environment:
  TZ: America/New_York

Pick your TZ from here

More info:
I suspect only TZ is needed, but it's better to have localtime and timezone set as other apps may use it.

Setting TZ in the environment is needed as of 1.0. Other issues don't mention this.

A quick check is to run date in your node-red docker's shell. For example, if your docker instances's name is node-red, enter sudo docker exec -it node-red date which should return the right date.

Next, make sure the problem isn't with node-red: create a function node with one line:
node.warn(new Date()); Here's a copy/pastable test to import:

[{"id":"d41fd22c.b3f2f8","type":"inject","z":"4db3e574.9051ac","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":1160,"y":120,"wires":[["d0e6a625.128f5"]]},{"id":"d0e6a625.128f5","type":"function","z":"4db3e574.9051ac","name":"","func":"node.warn(new Date());","outputs":1,"noerr":0,"x":1330,"y":120,"wires":[[]]}]

Note that just injecting timestamp (which is ms since 1970) and looking at that seems to use the time on the client's machine, which may not be the problem.

Finally, make sure dusk/dawn is set to schedule only to rule out issues with incorrect lat/long.

Hope this helps somebody.

light scheduler - schedule function doesn't seem to be working.

When I set the scheduler to have a light turn on at a certain time, it doesn't turn on. I set the scheduler to everyday, 24 hours a day and nothing. If I override the schedule with the "light only" option, the light turns on (it is dark currently) so that works. The "On" override works. Everything seemed to work last night when I first set it up, and the light turned off last night when it was scheduled to, but today the schedule doesn't seem to work at all. I don't think I changed anything. Everything else works. Any ideas?

Suggestion: Output Identifier on automatic output

I'm using your node to schedule my thermostats. I want them to only turn on if somebody is home, and to turn off at night.

I'm using LS for the schedule. The problem is, that I want some of my thermostats to only be triggered if somebody comes home and not by a schedule. This is currently (AFAIK) only possible using a combination of a LS and a LS-filter node.

I would like to only have one place to edit the schedule (to stay DRY).

Would it be possible, that the node, additionally to the set payload, outputs an identifier to know if the output of the LS node resulted of a state change, instead of a trigger input, or vice versa?

That way I could decide after the LS node if I should turn on anything.

If you have a better solution for my problem, I would like to hear it!

Updating Schedule by API

Writing an app I wrote to control entry gate. So far, I can open the gate, with the app, but if I need to make changes to schedule - need to login to node-red.

I didnt see in docs - is there a way to update the schedule by API? If not, can there be?

Time Zone Selection

Thank you for taking the time to create this useful node. It looks like you are using UTC time for scheduling. I think it would be quite helpful to have a local time offset selector so that the scheduling time would match the actual local time.

Expected behavior schedule versus sunrise/sunset?

If I configure a schedule to turn on from 06:00 to 23:00 with the settings "auto", "When state change", "Only when dark" and offset 0, whats is the expected behavior when calculated sunrise is 08:45 and calculated sunset is 14:53?

My expectation is that On payload is triggered at 06:00, Off payload at 08:45, On payload at 14:53 and Off payload at 23:00? Is my assumption correct?

Using the Light-Scheduler in the middle of a flow

Hi Niklaswall, I really like this node though using it in a different way.
In my use case a sensor triggers an event, which passes this payload to your scheduler, based upon it's settings it forwards the message to enable or disable a light. Since your node is one at the beginning of a flow, I needed to make some mod's for a middle-flow node. If you want I can merge it back, but not sure if you like the idea therefore checking.
I'm using your scheduler and evaluation / matchevent(), keeping the original payload (sensor info) in-tact. forwarding it to output 1 if matchevent is true, to 2 if false. simple as that. See it as an Light-Schedule-Switch. Plus added an option to not use the local timer, but be event driven.
I can also use 1 output as currently and add the 'on or off' message to the original payload.
Let me know if you are interested in this idea, otherwise also fine, I keep it locally.

JS Error when creating schedule

Hello, I am getting an error when I try to edit any of my light scheduler nodes. I have refreshed my cache and cookies and that doesn't help. It seems to have happened right once I updated to Node-Red 1.1.0. I am running NodeRed in Docker.

Here is a screen shot of the error
Screen Shot

switch off minutly output

Hey there,
i want to use your light scheduler with the output only when state changes option.
But i sadly had to notice that it only works at the off state.
At On state i can track a minutly output in the debug window.
Is this a common problem or is there a way to fix this?
If you need, i can post my setup of the scheduler.

problem with v 0.0.14

Hi, I have got a strange problem. It's not switched to ON even that everything is matched (correct positition etc)
Annotation 2019-05-10 110003

Problem with when-state-changes?

If I deploy a node that comes ON at 9:00 and goes OFF at 9:15 and I deploy it at 8:50 then it is logically in the OFF state. If I select "when state changes + startup", I would expect an OFF message immediately. However, if I select only "when state changes", I would expect an ON message at 9:00. However, about a minute after I deploy, I am getting an OFF message - presumably because the state is changing from 'null' to OFF. Or am I doing it wrong?

Output "when state changes" accting like Minutely

Since I upgraded to NodRed 1.0.1 I can't use Alexa (or HA) to turn off devices (if before turn off trigger). NodeRed turns devices back on if it's before the "off" trigger. (acts like minutely is set) Except output is set "when the state changes". Running HA 81.1 (just upgraded to 81,4)

New Override: enable /disable

Hi Niklas,
is it possible to add new overrides enable/disable, which prevents the node from sending payload at all.
My purpose is to have several scheduler, e.g one for schoolholidays and normal weeks. I want to decide which scheduler is aktive by override, depending on having holidays or not.

Offset for ”dark” calculation

Thanks for a great node!
Is it possible to add a offset function for ”only when ”dark”?
Set +60 or -60 means after or before dark

Node-Red Crashes

Any idea why this happens? I fixed it by disabling the flow that contained the light scheduler.

[INFO] Disabling SSL
[INFO] Updating IDE Users
[INFO] Adding IDE User admin
[INFO] Updating HTTP Node User
[INFO] Adding HTTP Node User admin
[INFO] Disabling Projects
npm info it worked if it ends with ok
npm info using [email protected]
npm info using [email protected]
npm info lifecycle [email protected]prestart: [email protected]
npm info lifecycle [email protected]
start: [email protected]

[email protected] start /usr/src/node-red
node $NODE_OPTIONS node_modules/node-red/red.js -v $FLOWS "--userDir" "/share/node-red"
17 May 12:06:14 - [info]
Welcome to Node-RED
===================
17 May 12:06:14 - [info] Node-RED version: v0.18.5
17 May 12:06:14 - [info] Node.js version: v10.0.0
17 May 12:06:14 - [info] Linux 4.4.50 arm LE
17 May 12:06:15 - [info] Loading palette nodes
17 May 12:06:23 - [info] Dashboard version 2.9.3 started at /ui
17 May 12:06:25 - [info] Settings file : /share/node-red/settings.js
17 May 12:06:25 - [info] User directory : /share/node-red
17 May 12:06:25 - [warn] Projects disabled : set editorTheme.projects.enabled=true to enable
17 May 12:06:25 - [info] Flows file : /share/node-red/flows.json
17 May 12:06:25 - [warn]


Your flow credentials file is encrypted using a system-generated key.
If the system-generated key is lost for any reason, your credentials
file will not be recoverable, you will have to delete it and re-enter
your credentials.
You should set your own key using the 'credentialSecret' option in
your settings file. Node-RED will then re-encrypt your credentials
file using your chosen key the next time you deploy a change.

17 May 12:06:25 - [info] Starting flows
17 May 12:06:25 - [info] [inject:d5c1650c.4188b8] repeat = 5000
17 May 12:06:25 - [info] [inject:601383c3.e3d7ec] repeat = 10000
17 May 12:06:25 - [info] Started flows
17 May 12:06:25 - [info] Server now running at http://127.0.0.1:1880/
17 May 12:06:25 - [info] [mqtt-broker:HA-MQTT] Connected to broker: mqtt://172.16.30.127:1883
17 May 12:06:25 - [info] [mqtt-broker:HA-MQTT] Connected to broker: mqtt://172.16.30.127:1883
17 May 12:06:26 - [red] Uncaught Exception:
17 May 12:06:26 - TypeError: Cannot read property 'toFixed' of null
at setState (/share/node-red/node_modules/node-red-contrib-light-scheduler/light-scheduler.js:39:63)
at Timeout.evaluate [as _onTimeout] (/share/node-red/node_modules/node-red-contrib-light-scheduler/light-scheduler.js:77:16)
at ontimeout (timers.js:427:11)
at tryOnTimeout (timers.js:289:5)
at listOnTimeout (timers.js:252:5)
at Timer.processTimers (timers.js:212:10)
npm info lifecycle [email protected]~start: Failed to exec start script
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: node $NODE_OPTIONS node_modules/node-red/red.js -v $FLOWS "--userDir" "/share/node-red"
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2018-05-17T17_06_26_740Z-debug.log

UTC Time?

I've seen a few people who have posted about this issue but they all seemed to magically resolve it. I have noticed that the schedule is firing about 6 hours before than the set time, which would be the UTC time, instead of my local time. As far as I know the server has the correct time zone set, since the debug log has the correct timestamps. All the settings for the node are setup correct as well. Am I missing something?

Can't add a schedule

VM908:7 Uncaught TypeError: Cannot read property 'event' of undefined

everytime im trying to add a schedule

Shutter control

Hi,
This is good node, I using it for shutter control, but now only work with scheduler only mode.
Do you plan to add a new feature? For dusk / dawn function "only when it is light"?
It would be a good idea if the shutter control was dependent not only on scheduler but also on sunlight.

Select Profiles via Node

Hi there, great timer. I have it hooked up to my boiler steup to act as the equivalent of the old boiler timer. What would be great is a way to send a command via payload to select a different profile eg: normal, holiday, frost etc. Each would have its on schedules.
Thanks and keep up the good work.
Simon

Nice

Hi @niklaswall,
👍 I was planning to do exactly this.
I just created a node red project for controlling my blinds and I was about to plan a project to calculate sun position to trigger the RF command to rise blinds (https://github.com/SergiuToporjinschi/rf-command) :)
You did a greate job here, I will give it a try. Nice work. Looks goof for now.
I thing you can remove the word "light" from the title, because you can schedule anything there.
Keep it going!

Manually enter exact times

It would be super nice to be able to enter exact times. Currently I don't see a way to do that.
So instead of the 15 min increments, it would be cool if I could define the exact minute for my schedule. Is that already possible? Or is it planned?
Cheers,
Georg

Sun position

hi,

would it might to incluse the sun position shown under the icon into the message array ?

regards Stefan

ON Payload Not Triggered

UPDATE - Sorry, I figured out what I was doing wrong. Didn't realize you have to put a schedule in even if you select the sun angle option. I ended up filling up the entire schedule and this seemed to fix the issue.

ISSUE - node does not switch to ON payload state when sun is at or below threshold. I want to use this to turn on some mqtt lights outside.

This is my first time using this node, so it's entirely possible that I've done something wrong, although I believe everything is configured correctly. My MQTT server connection is good and I have configured my location correctly (the sun angle feedback seems to be correct below the node). However, the node will not switch states to "ON".

I've pasted my flow info below.

[{"id":"73f5f767.dad938","type":"tab","label":"lightsOutside","disabled":false,"info":""},{"id":"365bc7cb.7d12e8","type":"light-scheduler","z":"73f5f767.dad938","settings":"5b73ffcf.5c1d9","events":"[]","topic":"","name":"Turn Off Outside Lights At Night","onPayload":"on","onPayloadType":"str","offPayload":"off","offPayloadType":"str","onlyWhenDark":true,"scheduleRndMax":0,"sunElevationThreshold":"6","sunShowElevationInStatus":true,"outputfreq":"output.statechange.startup","x":150,"y":360,"wires":[["bd3d1ba9.a413b8","a3f2af9c.adc89","36e73104.bffa6e"]]},{"id":"bd3d1ba9.a413b8","type":"mqtt out","z":"73f5f767.dad938","name":"Patio Light","topic":"cmnd/patio/POWER","qos":"2","retain":"","broker":"a7903fbb.08a58","x":430,"y":300,"wires":[]},{"id":"a3f2af9c.adc89","type":"mqtt out","z":"73f5f767.dad938","name":"Front Porch Light","topic":"cmnd/frontporch/POWER","qos":"2","retain":"","broker":"a7903fbb.08a58","x":450,"y":360,"wires":[]},{"id":"36e73104.bffa6e","type":"mqtt out","z":"73f5f767.dad938","name":"Garage Light","topic":"cmnd/garage/POWER","qos":"2","retain":"","broker":"a7903fbb.08a58","x":430,"y":420,"wires":[]},{"id":"5b73ffcf.5c1d9","type":"light-scheduler-settings","z":"","name":"Kansas City","latitude":"39.0570111","longitude":"-94.57455277777777"},{"id":"a7903fbb.08a58","type":"mqtt-broker","z":"","name":"","broker":"192.168.1.246","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closePayload":"","willTopic":"","willQos":"0","willPayload":""}]

Not functioning as expected

I've installed and set up the node and I think it should be working but it doesn't seem to be changing states. My location should be set correctly (although I am not using the sun settings). My pi timezone and time is correct.

Do you know of anything that could be causing this issue for me?

If it makes a difference I couldn't get one or two other timer nodes to work either.

Thanks

Add extra input

Would be very good to have an additional input (parallell to current input) with an external ”dark” trigger. For example if I have an own external lux meter I can trigger false or true and that means I can avoid light on if it is too light outside (via my external meter)

Schedules next to each other

If i draw a schedule with on ending 07:00 and another one starting 07:00.

Will the first send OFF and the second ON or will it jump over to the next schedule with no state change?

Randomize timer

Really want to use this timer, it has some features I really would like to use like minutely and the 'auto' input. But for me preventing to use it, is the absence of a randomise feature. So the on and off times can be triggered with a random delay for example between 0 and 30 minutes. Besides that, the best looking timer.

Trigger node output

Hi!
First, thanks for your effort in developing this. So I am looking for an option to manually trigger the output of your node. As far as I can see, it triggers automatically when the state changes depending on the schedule, at startup, minutely, or when I inject some payload to override the function. However, I am looking for a way to just trigger the node to output its current state. My application is that I have a bypass for the node if home is not occupied and I want to trigger the schedule to run when the home becomes occupied again. Maybe just an additional injection message that triggers the node to output, without overriding the node :).

Thanks
Samy

What about a default behaviour?

I would like a setting to configure the default behaviour of the scheduler.

So you could directly choose from auto/on/off/light-only/schedule-only.

Currently i am using an additional "startup" trigger to trigger an "light-only" message to the scheduler.

Request for enhancement

It would be great to have possibilty to support ”special red days”. For example 1st of May in Sweden is similar as Sunday...

...and thanks for a great node!

No outout on start-up/deploy

Hi,

I just have started to use your amazing node and like it so far. However, it does not generate an output on startup when configured.

My configured node does output based on schedule and sun-pos just not at start-up.

thanks for any advise and your great work

Wrong schedule time.

There seems to be a time issue with the schedule for my locations.
(-33.4269, +151.3418) is about 6hr behind.
i also tried (+33.4269, +151.3418) with no noticeable difference, perhaps its not supporting negative number?

Time zones?

Hi
Is the time always GMT? Or is the global position used for that? It seems always GMT for me

Opposing dusk/dawn thresholds to increase time considered "dark"

Hi there,

first things first: thank you for your awesome work. Absolutely loving your scheduler node and I am using it for over 10 months in my home automation now.

This ticket is a feature request and refers somewhat to #19. It makes total sense, to "move" the timespan, but I often find myself in situations, when I need it to "consider it dark earlier in the evening AND later in the morning". I also get it, that I can use two schedulers for that. But with increasing lights/rooms it gets quite confusing, fast.

So maybe you can give this a thought again?

best regards

Multiple/generic outputs

Great scheduler!! Thanks!

I really like the week scheduler of my (commercial) KNX visualization as it is generic for all device types. It allows to set a week schedule and you can send multiple values based on the schedule (e.g. on/off like node-red-contrib-light-scheduler or 1,2,3 or strings like “comfort”,“sleep”, “night”, “off”). This makes it a universal week scheduler.
This is how it looks like:
Overview:
image
Detail view:
image
Edit view:
image
Any plans to turn node-red-contrib-light-scheduler into a generic week scheduler?

Ciao,
Gagga

Adjust schedule in UI / Dashboard

Hi

Thanks for creating this fabulous scheduler.

I only found it yesterday, so I know there is a lot to learn, but straight off the bat I think I can use it to control our heating.

We have different zones, so one scheduler per room will make this a lot easier.

My question is...

Is there any way to offer just the schedule editor (rather than the entire node's configuration) in a UI like this one ?

https://flows.nodered.org/node/node-red-dashboard

No output produced

I moved from a raspberry pi to docker/nas and found this morning that my water heater didn't turn on during the night.

I found that there is no output coming from the node, except when I use the 'minutely' setting. How can i troubleshoot ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.