New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document connecting, open, close, error, states_loaded, services_loaded events. #75
Comments
I just had a poke through the source code, I realise now that there's connecting/open/error/close events, plus states_loaded and services_loaded as well. I guess these could be documented better. I can see a use case for a specific node for these messages maybe. |
I'm not totally following what you mean here.
Right now it's pretty easy to set up the connecting/open/close events using a If you wanted to do this I would like to see it work for all the current and future event types. That way we're just not adding a node that can be replicated with a couple already existing nodes. |
Just in general: once the HA connection is up and running, then do certain actions. Basically initialisation for the flow. I'll use an example: I've got an aircon unit that I want to be set a certain way at particular times of the day. I can wait for the time to change using something like a cron node, but say HA goes down past the transition time then I'd want to set it up when we boot up again. I think you're right that the existing nodes will do the job, although how to do this wasn't documented and it wasn't until I looked through the source code that I found those messages being generated. Happy to do the work for you in a couple of weeks if you want. |
I checked it, the events-all node won't pick up open events, I haven't tested close or error specifically however I don't expect those will work either. If you specifically request services_loaded the message that gets sent doesn't contain a topic, only the data. You can use the status like you suggested, this works if you check the status of an events-all node and set it's event to some dummy value. This is easy enough to encapsulate in a subflow I guess. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
When node red first boots up, sometimes it's good to set up some state in HA. There's a delay however between node red firing up and HA being ready.
One example of how this would be used is to set up stuff based on the time of day, where you'd want to initialise everything on connection.
Describe the solution you'd like
A connection state node, outputs topic.connected when connected, and topic.disconnected when disconnected. Each of these messages could possibly be optional.
It might also be an idea to have a list of entities that have to have their state available before the connected gets fired. This would work well for example with z-wave entities that can take a little while to boot up.
I can possibly contribute this myself, I've got some time off work coming up in a few weeks.
The text was updated successfully, but these errors were encountered: