#node-red-archived
1 messages ยท Page 108 of 1
In my flow, that's why I have the events:state node watching the bathroom lights. If anything turns on the lights, that portion of the flow will run. So, Alexa, HA UI, even the lights turning on via the switch and reconnecting to HA.
Seems like I remember seeing someone post a flow that would increment/decrement a number and pass that as a brightness setting over a certain period of time to the bulbs. @golden breach
@golden breach transition Duration it takes to get to next state. I use transition: 1 with most of my light turn_on/off service calls.
I don't think I've ever got that to work with my HUE bulbs.
I also have a function that I wrote that watches the alarm on my phone and will ramp up the brightness of my bedside lamp 30 minutes prior to the alarm. Part of the code posted. https://pastebin.com/dgeKh2aT (Still a work-in-progress but it is functional.)
Yeah. The Hue bulbs do not like it. Was working with a guy when we were developing the bathroom automatic light automation. I used transition:1 and things worked great. Same flow would not work for him. Turns out it was because he had Hue bulbs and mine are Singled.
thanks for the ideas!
Yeah, that's where setting up a loop to adjust an int for a brightness level is a bit more "universal".
Thanks @faint ravine, unfortunately I know almost nothing about Jasonata. There is only a single line in my Jasonata expression and when I enter it into try.jasonata.org it doesn't do a thing. Actually it can't really do anything because all it is supposed to do is to give me the 'state' information of a given entity. ..... I haven't got a clue about Jasonata ๐ฆ
Doing some more digging, I found that apparently $entities only work in the HA nodes so it looks like this will not work. Is there any other way to access the content of a HA entity in a 'change' node in node red?
on the left you paste your data structure. on the right you paste your expression. then you can play with it or ask for advice using your real data so you can get meaningful results. without seeing your data it's all very abstact.
Ahh, that actually makes sense now. I have abandoned my plan on how to compare two values and will go with the 'combining both values in a single message' concept that I previously thought was quite convoluted. I still think that it is odd that there isn't an easier way to compare two numbers against each other. I am comparing the maximum temperature of a sensor over the last 24 hrs against a setpoint (fixed value in a helper entity).
i compare numbers using .msg
like "is basement warmer than living room, if so turn on circulating fan"
@tribal vortex
BTW, it helps to keep in mind that arthmetic in JS is done via float, so these crazy "bugs" are quite common. Compare to the one with $round()
i made a binary sensory for workdays and want to have an automation to run if that sensor is true ie if weekdays lower my bed in the morning after x time
anyone know how i can do that?
Thanks @golden axle, that is essentially the same thing I am doing and the way you are doing it was the way I was trying to do it but for some reason or other I could not do what you are doing. I will give it another shot with your method as an example because it makes way more sense then using the join method.
cheers, good luck
chronos can do everything:
https://github.com/jensrossbach/node-red-contrib-chronos/wiki/Scheduler-Node
First time using the entity node, but it worked for me. It looks like it only supports binary sensor, sensor, and switch. The timestamp in device class is what is giving you the unavailable. Change it to sensor and you'll at least get the data into HA.
I think my issue was that I was sending timestamp in seconds and it expect milliseconds.
I just need to timestamp x1000 and ir worked
You should be able to send whatever you want. When I was testing the node, it worked fine for me with various data but when I set the device class to timestamp (like in your screenshot) it became unavailable. And, technically, the default device class is sensor so leaving it blank would accomplish the same thing.
Hi i am still learning Node red and I want to set a condition where if motion is detected upstairs after a certain hour to flash a light in my living room.
The current motion works but how do i add a conditional time?
yeah im trying to wrap my head around it and getting stuck
ha, there's a bug - the last line should be 01:59 ๐
- install chronos
- set up your location (for proper TZ)
- insert
time switchnode - only use one interval,
betweenrequired times
outside of the times specified the node won't output anything.
just prior to the action node. e.g., motion -> check time -> send signal to your light.
here
but if i want that to run but ALSO trigger a light to flash downstairs whee would i put this?
ah, you just want a signal, not to interfere with the on/off processing?
then just add another flow, 1 sec
so basically if my kid goes to sleep i want to flash the light downstairs and also turn the lights on upstairs.
sorry this is simple i know but trying to wrap my head around it
if she gets up sorry if she wakes up lol
so when motion happens, two nodes are activated - your "upstairs lights on" and this new time_switch.
ah nvm i manually added a time zone in my chronos config
took that out and it "looks" to be corect gonna test it.
Anyone had any issues with NR with recent HA upgrades? I've noticed that I have multiple entries in my server field has four entries, and when I type anything in the "area" field, there's no autocomplete anymore.
Also, the device was a string of seemingly random characters, presumably the UUID or something? Anyway, it seems to have literally just fixed itself.
I've cranked logging up to debug, guess I'll just wait for it to happen again.
After restarting, the issue is back..
ah, I have imported a new flow recently...
Alright, all cleaned up, restarted and functioning properly again...Thanks @cobalt dock
Probably my fault if you imported some of my stuff. I forgot to run it through the scrubber before pasting.
When using zha events I get multiple "on" events from my IKEA Shortcut buttons. How can I process only the first one and ignore the other events for the next x seconds?
what's a "scrubber"?
why not use filter (previously known as RBE) node?
It removes the configuration settings that are in my flow. If you import my flow without being scrubbed, NR will be looking for my stuff. I think it can have around even after you've made changes to accommodate your devices. Just something that needs to be cleared periodically.
Do you have an example how to use it?
yeah, I mean - do you use a specific app/service for that?
there's nothing to it. just include it after an event node. it defaults to remembering the value of msg.payload. if you want to monitor something else for changes - just set it up.
or just play around with this:
https://zerobin.net/?7681cf4075950d2e#FLx0Qoq8NrOfUvee5daTF4h9n6m+S2M3fWlc+CDqixU=
The link @cobalt dock posted above is the scrubber that I've always used. https://zachowj.github.io/node-red-contrib-home-assistant-websocket/scrubber/
Node-RED integration with Home Assistant through the WebSocket and HTTP API
missed it. thanks!
Hi all. i have this sequence that i created (with @golden axle awesome help!) to simulate presence inside the house but randomly launching a script (some audio recordings) every X minutes. i was wondering if there is a way to make it also alternate (randomly) between the 2 scripts?
current state: https://pastebin.com/bhPuDL9a
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
node-red-node-random should work
or this
thx guys
@faint ravine , not sure i understand the example with the $floor command?
and how does the 0/1 connects to the scripts
$random() generates a number between 0 and 1. multiplied by 2, so it's 0 <= random < 2. $floor() rounds it down. so the result is a random number: 0 or 1 . so the switch node activates either the first output or the second.
you attach your first script to the 0 output, and you second script to your 1 output.
got it thx so much !!
Or... make the two scripts into one bigger, better, more powerful script... ๐
I went from a couple of smaller scripts (screenshot 1) to just a single script that contains everything.
and soon you ask yourself - "why do I even need NR?!" ๐
(sorry, couldn't resist ๐คฃ)
is there a way to reuse some of the nodes?
i have a node called "Away mode", which basically just returns true if we're away.. and false if we're present
i want to use this for several different flows
Take a look at the Link In/Out nodes. Basically, they create a connection without having to run an actual wire. You may also consider looking into a subflow if you're running the Away Mode flow a bunch. The concepts are basically the same between the two.
But... now that I re-read your question, I don't think that's what you're looking for. You should be able to "call" the Away Mode variable. I'm not sure how to do that but lemme see if I can figure it out.
you have two options:
- use
link callor a subflow - store home/away data in a variable (
globalorflow) and check it.
I think option 2 is more like what he is looking for. Probably several flows that check if he's away to allow or prevent it from flowing.
Node-red nodes pass the msg object between nodes. However this object is replaced by the next msg object. So how do you store data between node calls? Node-Red provides three mechanisms: The context object -stores data for a node The Flow object - stores data for a flow The global object -stores data for the
I'd probably do a link call with something like HA: get entities node, then just do a quick $count(payload[state='home']) so see if at least one person is home.
otherwise you'd need to intercept events like left/returned.
or better yet - monitor state change and get entities on every change, store variable.
Hi guys. Im completely new to Node Red. Im running Home assistant from my Synology NAS, so no supervised mode. How do I then install Node Red on HACS?
Hi all, I need some guidance on a flow to control lighting when motion is detected
I have a room with 2 sets of lights, let's call them near and far
If neither set of lights is already on, I want them both to turn on for 30 seconds when motion is detected and then turn off
If motion is detected again within the 30 sec period, then I want the timer to start again (or extend by another 30 secs, I dunno which one is easier to implement)
However, if lets say the far light is already on when motion is detected, then the flow should only apply to the near light i.e. motion detection logic shouldn't be applied to any lights already on
I've got this as a base:
if you're running HA on docker, use that for NR
install the NR companion via HACS and the NR companion integration via integrations page also
@solemn summit i use stoptimer-varidelay to do this
example: https://paste.debian.net/1247119/
Node-red is a separate entity. It can't be installed via HACS. You need to install it separately. Only then, if you like, you can install HA-NR module via HACS. But it is not required for normal HA<=>NR operation.
in your trigger node set this
Could someone explain to me how to compare value form message.payload to the value from sensor?
If it's even possible
Idk, because I'm beginner
The documentation for the link call node says "The flow connected to that node must end with a link out node configured in 'return' mode."
I can't find any way to configure a link out node to be in "return mode". Any idea what this is about?
Oh wait how did I miss that. Found it...
current state node
Hi may i know how do i solve fail to load node catalogue ?
Do you have any blockers installed? Ad blocks, no script apps etc. You can also try opening your node red installation in a different browser. I used to use Chrome for that because my regular browser was too locked down.
And also my modbus flex node shows connected but there is no value been shown , the value should be in dec or hex
And im sure the modbus is working
Tysm
just getting started in node red, is it better to have a flow with many actions or quite a few, far more simple flows? I feel like i am running into async issues.
I use flows (tabs) for organization, no harm in having multiple functions there
eg, 1st floor lighting, 2nd floor lighting, HVAC, media center
i wrote a flow for each motion sensor/light pair and then refactored it to be a single flow for all the pairs. it still works but with weirdness when more than one is triggered while another is running
it shouldn't matter. everything is asynchronous under the hood (although node.js itself is single-threaded).
thanks, that is what i was reading but wasn't sure. basically next function that is being held(ie a delay) fires asap?
flows are technically the tabs themselves, i think. ultimately it's up to you how you want to handle it. some people get a little too caught up trying to make ~~the flows ~~ an action as small as possible, in my opinion
i think i fell victim to that last bit, and made it unnecessarily complex
that said, if you enjoy it, then go for it!
starting out though, i recommend getting your core stuff settled. there's a lot to learn here
and you'll probably refactor again when you figure out there's a node out there that does everything for you
it looks so cool though. yes 100% so much to learn, its exciting
thanks alot ya'll, appreciate the quick help
cheers, good luck
don't forget the sercret code of NR "node red thing you want to integrate/action you want to perform"
Node-RED integration with Home Assistant through the WebSocket and HTTP API
def will want to check some of this out
oh nice, that looks super helpful. thanks!
for sure
the away boolean is manually set by us.. when we leave the cabin
it should then go into away mode
i don't have device tracking at the cabin, so we do it manually instead
@trail bobcat you can also use subflows to make your own nodes that are reusable
going back to the original question
then you can just get the value from HA.
Suggestion needed. I have live data of time stamps of multiple people coming online (which i fetch via http nodes).
I want to make this data visually easy to view, like how many times a day, who was online, for how long etc. I was advised Graphana & influxdb (is it right? I also heard they are pro tools ).
I am new to them but i have just successfully setup addons on HASS. Can someone help me setup basic charting first time, i am new to both of them.
Thanks in advance
yes, but i don't want to have several nodes in the same flow that basically just does the same
because i have several automations that should check if some appliance should turn on.. all of them should first check if we are on the cabin.. if not, then don't turn on
and vice versa if we are
Would be interested to see what this looks like for you. That was one of the first things I did in NR after migrating everything off automations
I have a trigger state that listens for binary_sensor's, then filters further by domain for motion sensors, then gets the area that sensor is in, then calls the light.turn_on service on that area
I've since added some more nodes in that action for more complex behavior, but that's the core logic
Also on the topic of your original question about organizing. I started off and still have flows for generally similar things, like a "lighting" flow, but I think @golden axle makes a good point of not getting caught up in the size of your action. I think because I have a bunch of actions per flow I tend to try to keep them smaller probably to my detriment
Also on the topic of organizing things, do you guys share event/state change nodes for all actions or create a bunch of state change listeners that have unrelated actions.
For instance, I have a listener for my motion sensors to turn on lights. I also have other actions like turning on TVs/monitors when there's motion. Would you keep that all in the same action or create a bunch of different actions even though the state change node would essentially be duplicated?
sure thing, not sure of the protocol here to share stuff, should i upload the file or copy pasta the JSON? i have been at work all day so havent made any progress since early morning convo.
I think there's some way to paste here and it shows up as a picture? But I was just wondering at least at like a high level how yours works
Did you just take a picture?
aye, working on a better pic now
super rough drawing. wasn't sure how best to present the info but I tried. please ask questions, i love to learn. also, this is not working as intended in this pic as i am working on it right now
Nothing is wrong with what you're doing this is just to show you another take on the same type of flow, completely untested. The map node is part of node-red-contrib-map https://pastebin.com/raw/je2qY6Gq
I have a state event node that uses this jsonata $number($entity().state) >= 5 and $number($entity().state) <= 5.15 this checks if the value is inside that range. How would I adapt it to check 2 other ranges as well (no overlap in the ranges) thx
so ($number($entity().state) >= 5 and $number($entity().state) <= 5.15) or ($number($entity().state) >= 11 and $number($entity().state) <= 11.15) or ($number($entity().state) >= 16 and $number($entity().state) <= 16.15) ??
so you want to to be true if it's in any of the ranges? then yes what you pasted
yes and unless I'm doing it wrong
what I am trying to do is this
I have a "runtime" sensor for the day (today)
I want to trigger something when it hits 5hrs, 11hrs, and 16hrs.
(sometimes it does not hit 5.00 and will go from 4.99 to 5.01 or 10.96 and then 11.04)
I don't mind if it re-triggers, I have it ignoring duplicate state, and I also have a check that comes after it that would prevent double triggers.
Sorry, the resolution is too small for me to make anything out
Which one there is the map node?
Oh I see, I just imported it. I feel like I should browse around more for nodes to see what's out there that might some of my actions more succinct
I also feel like I should be using the trigger node more, cuz I don't use it at all and I see people using it all the time
I use the "wait until" node for my light timeouts, but maybe I should be using trigger instead?
@cobalt dock That's really slick with the light timeout using the trigger node. I think I get how it works now. There's one big problem with using it for light timeouts though. It seems like it looses state when node-red is deployed. That means my lights that are currently timing out won't until there's more activity
I'm trying to iron out what I think is a wifi congestion problem. I have devices constantly (any random device will become "unavailable" a few times per day. Sometimes as many as 10. Not all at the same time. Is there a way I can use Events:all to filter for any time something becomes unavailable, and just send myself a notification? (I don't necessarily need to know which device)
this is what it looks like (in this case it was the most recent WAP reboot but its the same randomly)
Hey folks, I've got a function node that returns the brightness of a light into a trigger node which returns some JSON to a call-service node. How do I reference the msg data in the JSON?
"service": "turn_on",
"data": {
"brightness": INPUT_FROM_FUNCTION
},
"target": {
"entity_id": "light.front_foyer_lights"
}
}```
nm, got it working with a template node
if you click show original you can zoom ๐
updated to HAWS 0.43.1 and all my template (data json) node -> call service node, have stopped working.
no error in debug.
its like the data json is being ignored.
this one actually errors out, because it thinks the data is empty.
was this functionality of passing in json data removed at some point?
the above is a flow that used to work and now does not.
also, i'm on NR 3.0.0 if that matters.
Node-Red 3.0 is out
oh, old news
apart of having to chown 1000:1000 -R the data directory, no hiccups
node-red-contrib-dockerode is breaking with "System Error: [undefined] undefined"
just a heads-up if you use it
seems it's related to the dropped privileges, can't access the docker socket any longer
AND is much easier done by using two consecutive switch nodes ๐
Hi Guys. I'm completely new to Node-Red. I just tried a basic setup which should let me read the status of my light in the debug console. The entity's shows up in Node Red from Home assistant, it even says running, but when I flick the light, nothing happens in the debug console. Any idea of what might be wrong? Thanks for the help ๐
screenshot the inside of the HA node
I read somewhere that I should check the version, but this should be up to date right?
And this is my npm version
Btw I tried running an inject node to debug, that worked. So the problem has to be between Home assistant and Node Red
could you explain using switch nodes?
Instead of (condition1) and (condition2) in a single node you can use condition1 in the first switch node and condition2 in the second one. This way it's much easier to understand afterwords.
remove "Hei" and it should start working.
Currently it's testing the state against "Hei" and obviously it never matches.
@faint ravine I'm not triggering based on time of day, I'm triggering based on a sensor value of runtime_today
the "conditions" are time values right around the "trigger" time. since it does not always hit "5.00" hrs
sometimes it skips it and hits 5.04
does that change your suggestion?
it will also never be more than 1 of the 3
my suggestion is regarding the ease of understanding. it has no relevance to the logic.
oh
in your example condition2 will not be tested if condition 1 is not true correct?
yes. if switch1 fails, that's it.
ok so how would it apply to the specific logic you are suggesting it for?
oh you were basing it on the "and" discussion. we had clarified it is "or" that was needed. sorry for any confusion
now i get what you were saying
I'm just saying that if a complex and is involved, I'd rather split it into multiple nodes.
It's a philosophical question, really. I love the visual part of "visual flow programming" and hate writing actual code. So my flows are descriptive and banal/obvious. Some people prefer to get very concise flows with lots of function nodes.
Thanks!
Ah, it still looks like you're doing a lot of manual mapping between different things which I wanted to avoid. I guess once I get my devices all in place it doesn't matter as much, but I can just add a new motion sensor or light to an area and it just starts working
yeah, you can cover a lot of the same functionality with some uniform naming of devices. The detection part of my whole alarm system is just this:
Yeah that's a great strategy too. For some reason naming schemes have always bothered me, maybe cuz I'm a developer, so I try to use metadata to do the associations (e.g. the entities area)
I wish there was a way to add custom attributes to entities
Or just better data structures as helpers in HA or something like that
โ๏ธ Is influxdb and graphana good tools for this? Any advise or help?
You'll want to ask in #add-ons-archived if it's about an add-on
HAWS 0.43.1 and NR 3.0.0 doesn't seem to work.
call service nodes are ignoring json {data} passed to them.
half my flows are not working.
i reverted to NR 2.2.2 and it still not working, so this is clearly an issue with HAWS 0.43.1
my whole house is down, cuz all i did was update to 0.43.1, thanks alot.
pretty much anywhere i am using a template node to build a {data} json, then pass it to a call service node is broken. which is, like, everywhere.
I got a weird issue that I can not resolve in regards to Node-red on HA. I'm dynamically sending an input_text state to a "call-service" node but only the message field gets formatted correctly while the actionable button in notify looks weird like in this picture. Is this a bug I found or expected? This is my JSON code inside the call-service node if it helps anyone "
{
"title": "OmniPod",
"message": "{{payload.omnipod}}",
"data": {
"actions": [
{
"action": "URI",
"title": "{{payload.omnipod}}",
"uri": "{{payload.omnipod}}"
}
]
}
}
"
if you build the json inside the call service it works.
so now i gotta spend a whole day, cuz its gonna take a whole day, retrofitting all this.
i'm using a function node to build the json and not building it in the call service node
how were you building the json before?
By default, Mustache will replace certain characters with their HTML escape codes. To stop this happening, you can use triple braces: {{{payload}}}.
thats not it either.
the call service node is ignoring the payload sent from the template node.
Wow it works now, I tried the three curly braces before but had the "Use alternate template tags for each data field"- option active which didn't work. Took me three full days to get this working now. Thank you! You might have saved me literally even more days of troubleshooting work ๐
if i use a function to make the {data} it works.
use a template node, and it doesn't work.
yes i agree, i was trying to avoid any hard code or hard links. my original goal was to build a dynamic function(flow) that i could then apply to any motion light. Pulling info and traversing domains is still beyond me in NR though apparently. Naming schemes is something i am a bit lazy about in HA, my excuse is that things like phocon add in their own and i can't modify it.
I try to make use of templates when I can since they're really powerful. That's how I get the area for an entity
So you can just do area_id('entity_id')
I use z2m for my Philips hue lights (and a few other types) is there a way to create effects, colour loop, blinking a specific colour etc? Also is it possible to sync them in any way to Spotify (or tidal)?
Effects: It's all in the payload. Go to Developer Tools โ States, type the name of the entity and look at the effect_list
How are people outputting time? All the code I'm seeing around Date.now() seem overly complex and I'm wondering if I've missed the memo on simple time formatting.
I'm currently in the process of converting my remaining YAML automations to NR and I'm trying to get the NR equivalent of:
payload_template: 'Time: {{ as_timestamp(now()) | timestamp_custom(''%H:%M:%S'') }}'
hmm...created a sensor for time...much better
moment node.
funny....when asking a web dev friend of mine about JS time formatting he mentioned he uses the moment library.
Ah thanks! Is there a way to make breathe continue indefinitely? If I use the effect it pulses for around 16 times and then stops. I don't want to create an infinite loop if possible
http://docs.jsonata.org/date-time-functions
JSONata. The general idea - all goes through milliseconds. Then you can compare, add/subtract, then convert to whatever you need.
Well, you're going to have to do a loop of some sort, that's just how it works.
Go watch this: https://www.youtube.com/watch?v=SML9yQjlD_s
Tutorial on how to recreate hue labs lighting effects in node red! Who needs the hue app any more!
Intro: 0:00
Guided Breathing: 2:11
Briefly Bright: 3:32
Workout: 5:37
Flows: https://github.com/willbob8/willsurridgetech/blob/master/HueLabs.json
Alexa Media Player: https://github.com/custom-components/alexa_media_player
As an Amazon Associa...
Hello,
How can i use a entity in the if state field
Ty!
Node-red stops responding and the only thing I can see in the logs is this entry in the log: "Received event for unknown subscription 3. Unsubscribing."
have googled but can't find anything related.
have tried uninstalling the addon and re-install
do you run ubiquiti products?
yes
probably related to this https://github.com/zachowj/node-red-contrib-home-assistant-websocket/issues/646
looks like it.. so there's a bug that they are looking at? doesn't seem to be a fix?
not sure I understand the relationship with Ubiquiti
it's just my assumption at this point. I need to find some time to look into it
OK no worries. Happy to test anything if it helps!
you can post your logs in that issue, turn on logging or websocket_api https://github.com/zachowj/node-red-contrib-home-assistant-websocket/issues/646#issuecomment-1180893200
turned logging on and will post on GH, thanks
when i try to install my pallet it tells me node red doesn't have permisions
@devout maple posted a code wall, it is moved here --> https://hastebin.com/dodecimaci
Why are mustaches not working within certain service calls?
this for example will produce an "invalid value" error:
{ "dev_id": "auto", "location_name": "not_home", "gps": [ "{{latitude}}", "{{longitude}}"] }
Am I missing something?
just use jsonata,
but if you insist on using mustache, I think the issue is that coordinates have to be floats, but you are escaping them as strings
so lose all the quotes
@devout sage Already tried removing the quotes, but that produced a syntax error.
I was already using JOSNata, did not know variables can just be inserted without using mustaches. Thanks.
oh wow that's a first. I managed to create a flow that cause nodered to go into a boot loop
better stay away from trying to create complex jsonatas on the state changed node, it will probably evaluate those until it dies
$entities("sensor.scooter_charger_energy") <= 10 or $entities("sensor.scooter_charger_energy") <= $entities("input_number.scooter_charger_cutoff")
the <=10 was a mistake, it will always return true if it's not charging
<= [1..10] would work probably?
in [1..10]
I have an issue, I think being caused by my WAP where devices become "unavailable" - I'd like to use nodered to watch for any device that becomes unavailable and have it notify me which device and when it happens. I have plenty of use of nodered to do this when one specific device does something, but not sure how to 1 - watch for the "unavailble" situtation 2 - remember the item and pass it to a (variable?) and then how to use that variable in my notify node. Thanks for any assistance ๐
Make a global var, a hash, where the "key" is the device_id. Store last_seen (milliseconds) there, and reported (boolean), initially false.
Then periodically use JSONata to find devices that haven't been repoteded and have last_seen older than something (say, now miunus an hour). Don't forget to set the reported flag ๐
something like:
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
they only go offline for 10 - 20 seconds I think that approach would never see it
Unless you receive something from them periodically - sure.
most of these devices report every 10 seconds
but it seems to be noticing them going unavailble in the device logs
im gonna try this out (just found) its based on state being 'unavailable' https://community.home-assistant.io/t/looking-for-a-unavailable-trigger-into-notification/286523/3
Hey, thanks for the quick reply. Thanks to your help i did the following: #Notify when device offline - id: notify_device_offline alias: device offline mode: parallel trigger: - platform: state entity_id: - light.attic_light - light.baby_room - light.cupboard_light - light.dining_room_light - ligh...
haha, how do you think they come up with this state? ๐
I just want to watch for the state, your suggestion (I probably misunderstood it) made me think i was just going to poll for lack of reported data
I was hoping it was a direct trigger
if the device doesn't report, it's considered lost. I can't think of any other way ๐
HA knows its 'unavailable' it's a state, not my human description of it being missing
yep. how do you think HA "knows" this?
ok true but HA is watching in nanoseconds, you mentioned above checking once per hour?
it's configurable, duh ๐
ok but can't i just watch for the state the way I would watch for/trigger for 'on' ? not sure why I would manually poll ?
there's no polling as such. just periodically checking the values of a global variable. something has to do it ๐ HA or yourself
New right-click context menu, junctions, continuous search, default node names... time to update!
That does look a lot better
I might hold off a few days in case some bugs are uncovered, or as long as I can at least haha
haha...me too.... so fear NR update problems and breaking down something important and then reverting!
I haven't yet but I've only used it 6 months or so. It's just a major version upgrade so it seemed like a good idea
โผ๏ธ SOS: silly fingers deleted a flow. Even did more changes in other flows & deployed after that (so cant do CTRL+Z). But quickly saved the nodered directory flows.backup.json file. Remember the flow name too, but how do i extract it out of so many pages of json (700kB)?
Any syntax check to extract it out?
surprisingly, no updates for days. means they did it right this time ๐
I had one issue related to running as root, in docker so I don't do that anymore. just added the nodered user as a member of the docker group in the compose file
welp, my node red keeps crashing since the update D:
Ah reverted to the previous version and it's still crashing...
I need something that sends the current payload as msg.payload and the previous one as msg.payload2. So I made this function node for it
`var buffer= context.get('buffer');
buffer.unshift(msg.payload);
msg.payload = buffer[0];
msg.payload2 = buffer[1];
buffer.length = 2;
context.set('buffer', buffer);
return msg;`
Does it seem like a good way to do it?
Cause I'm getting huge RAM and CPU usage and I'm not sure if it comes from the upgrade to 3.0 or if my function is not doing what I'm expecting it to
Nevermind, turns out diffing images with node-red-contrib-image-tools uses a ton of resources.
howdy, i'm having issues where i can't edit function nodes
this error pops up in developer console when i try to edit.
i reverted to 2.2.2 from 3.0 and it is now editable
function editor seems to be working on 3.0 for me although I notice the dark mode isn't working for it anymore.
Did you ever get this to work (sorry for the wake up post ๐ )
Same here, but node functionality is not affected
Does anyone have a flow they're willing to share that takes the output of an IKEA remote that successfully incorporates dimming? I've got a flow that on/off work fine, dimming however "works", but it seems to jump to 255 (up held) or 0 (down held) near instantly. So alternatively, if someone could look at my flow here: https://pastebin.com/c9YEdnQm that would be very much appreciated.
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
It's a well-known problem. Dimming isn't supposed to go via hubs, it's for direct binding.
Hmm, good to know. Unfortunately, while the dimming in the flow on Pastebin only targets two Hue bulbs, the on/off also targets two Lutron switches and my plan was to extend the dimming to all 4 lights once I sorted out the proof of concept on the Hue bulbs.
So has anyone found a good NR-based solution?
Not an ideal solution, but still - you can bind it to a light, so it operates it directly.
Then you can monitor the on/off status of the light (via zigbee=>mqtt or ZHA) in NR, and set the power to other lights accordingly. Not ideal, but something.
Yeah, Iโll give that a try and see if itโs acceptable, thanks for the suggestion.
Mine looks like this and probably is the same basic concept, but using a different node: https://pastebin.com/axVtzC5y
Not sure if this works better/ worse than yours.
Besides that I'm not setting the light brightness directly, but increcment/ decrement an input number. Light brightness changes when the number changes
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
@covert onyx posted a code wall, it is moved here --> https://hastebin.com/tamuhelaru
Does anyone have a node red flow that adjusts blinds to the Suns azimuth?
I made a function that handles my IKEA remotes. Dimming is supported along with cycling RGB colors. Code is a bit rough around the edges (was a learning experience that has been updated as I learned new stuff) but it works well and includes comments.
https://pastebin.com/hDsd9V1k
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
try setting if state is not unavailable in that current state node
thats what im hoping to achieve but it seems to error out if that entity is offline
I'm kinda also looking for something like this.
I have a screen that covers my solar panels with shade and i would like to open that cover once the shade hits the solar panels
Would it be possible to compare 2 solar panels and have it lift up the cover once there is a 5-10% difference in generated watts?
I have 503-errors showing in gui for NR, and was tempted to reinstall Node-red. How do I best preserve my flows and nodes and put them back after reinstall?
maybe this can be of help? (haven't tried it myself) you could get the degrees (payload.azimuth) and then check the range.
In 3.0.0 when I paste code into a function node, it formats the code in a different style than what I like, is there a way to turn it off so it just pastes it in as before, without changing anything?
I'm trying to set the state of person.Tinman to store
but I can't make a call service node work if the domain is set to person
also tried the update entity service, and nothing happens
What's the best way to gate some action from continuing based on ORing together a bunch of different conditions from different entities?
So basically an action triggers, then for example I want to check if the bedroom light is on, or the back door is open or the dishwasher is on and if so have the flow continue on
Right now I'm funneling them back through a delay node with a rate limiter, but that's kinda hacky and error prone
Seems like it should be simple enough, but I can't figure it out
switch nodes in series
Yeah maybe I couldn't use a current state node here?
either
Replying because I also want this.
Not sure how this would work. If one condition failed it wouldn't continue onto the next, right? That would work for ANDing some conditions, but not OR
I think what I could do is get the state of all the entities, then feed it into a single switch, and then configure that switch to "stop after first match"
still can't figure out anything
is a call service even the correct node to use if trying to manually update the state of a device_tracker ?
Anybody know if it's possible to run an npm script with multiple files? Doesn't have to be through node-red
Not sure what you mean by multiple files
Just a node project containing multiple .js files
You'd run one file and import the others I assume?
Yes
That doesn't work?
I just don't know of a way to do so
Well I think that's outside the scope of this channel. You might just want to read up on how importing works
I just thought that since node-red is built upon node this would be the way to go
Also wym how importing works? Just by doing import { thing } from 'package'?
hi anyone know how to connect bacnet using node-red on HA >??
i always get the error time out error
Are delay nodes supposed to "override" each other? In the attached image I only get a resulting delay of 250ms:
Hi, does anyone have a node red flow for arming and disarming a Konnected alarm please ?
Got the door sensor to chime on open on node red via echo
hmm, seems the moment library used in Node-RED is lacking the duration method
Hey, is it possible to do an automation including a CCwGTV with node red? I want to use CCwGTV, for examle when I turn it on, then all lights in room should go off and curtains close
I'm new to node red so I'm still watching guides and learning nodes
But I can't find an appropriate node to assign CCwGTV
The whole automation would be like this: if CC is turned on, then turn off lights and close curtain. If cc is off, and it's 10pm, then turn on lights and close curtain
So I'd use those states of CC
I was able to do something like that using the HA automation, but I want to use node red completely
No knowledge specifically about Chromecast stuff but try adding the pallette node-red-contrib-cast. Maybe this will set you in the right direction. https://flows.nodered.org/node/node-red-contrib-cast
@fair cosmos Looks like there might be a newer fork: node-red-contrib-castv2 https://flows.nodered.org/node/node-red-contrib-castv2
Hmmm, I'm not sure that that's what I'm looking for
Yeah, looking at the new one too
Don't think I need it, I don't need to control my CC more than the HA default media player does
if you already have it as a media player just use that to do your automations in NR
That's what I'm asking, how would I use it. I added the events:state node, selected the appropriate CC, connected that to debug node, to see what's the exact state name when I turn on the device
If you have entities in HA, your should be able to read the states in NR
But it doesn't give out anything
what does the state show in HA dev tools?
Oh good, there it says off
How do I find out then the other possible states of an entity?
Wait, it's actually not off
Lmao, this is so complicated for a noob like me ๐๐๐
I guess I do need other integrations
HI any one know how to solve this error ?