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
[Enhancement] Possibility to send the value of a device when Nodered start. #3
Comments
what's your use case for this? |
I would also like to see this as when you create a UI in Node-Red or have another program connected to it and you shut down node-red and the devices change in HS it is not updated on startup so the data that is held is wrong until the device changes value. |
I see, so what about adding a new "sync" topic, i.e if a HS Device node receives msg.topic: "sync", then the node would get the current status/value from HS, update the node status next to the yellow dot, and propagate the status/value to the flow. Note that in the current implementation, at startup the current status is retrieved from HS and the node status is updated, but not propagated to the flow. So, node status should already be ok, can you confirm this what you see? |
Yes, I believe the node has the correct value but we need a way to update the flow so the items are in sync. What you are suggesting would work as we could use payload = Started! in an inject node to trigger the sync on startup but it would be much better if there was a checkbox in the node to update the flow on startup so we did not need to add an inject node to do this and it was part of the HS node settings. |
Would Context Stores work for you? https://nodered.org/docs/user-guide/context Persistent Context saved to a file and therefore available on a reboot of Node Red. |
@KSumwalt this could be done but is a lot of work. I am trying to make the HS node as user friendly as possible without requiring the use of other nodes to make it function. |
After re-reading this, since the HomeSeer devices are up to date, why not start any flow that would require the "sync" on startup? https://cookbook.nodered.org/basic/trigger-on-start To me, ease of use means consistency within the platform. This being Node Red. If I went to the Node Red Slack or Stack Exchange and asked how to make this happen, I believe I would get the above solution. Which is a solution which works for other nodes outside HomeSeer as well. |
@KSumwalt |
Did a little more investigation. The Status Node can be triggered when HomeSeer changes a device's status. Since this occurs even during startup, it can be used to send the value to a flow. You just need to set a payload based on the status text and add it to the appropriate place in the fow. See my post describing using this to keep a Dashboard UI sync'd with HomeSeer in the HomeSeer forums. |
@spudwebb @KSumwalt |
Another scenario is just wanting a node to send its status as a message, without necessarily needing a sync. I suggest at the same time adding a "report" topic that skips the querying HomeSeer part but does send out the status. |
Guess I am just amazed that we are discussing a programming platform and do not want to set a variable to be read later nor, apparently, use built in capabilities. I am not trying to be argumentative and if I come across as such, I apologize. I am only trying to suggest that there are ways to get the end result and that there is something to be said for being consistent with other items which may be in our flows. Such as thermostats, vacuums, and other items not supported by HomeSeer nor the various plugins. @Enigmatheatre are you sure you wouldn't need only 5 nodes total for all the On/Off devices? Plus a single Change node for eaach different type of item passed such as one change for all the Dimmable devices to pass the dim level? I posted a follow-up which added a few more devices and only a\one Switch Node to send the payload to the proper UI item. So my single example is not repeated for each item. I respect your coding capabilities and suspect you may have realized this, but the support person in me can't make that assumption. I also do not know exactly what your flow is so I could be in a different direction. |
I will add a "sync" as well as a "report" topic., and probably a setting in the HS Device node to sync on startup. |
How about the ability to get a list of all HomeSeer devices and then poll or control them? If I want to control all devices in a given room, category, floor or combination? Get me a list of the devices and their current values. Make it more dynamic as opposed to me needing to add/remove items manually. |
In version 1.0.4 I added a "sync" and a "report" option for msg.topic, as well as a "Report state on startup" setting in the HS Device node config. |
Having the possibility to autosend the value from a device to node red when nodered start would be useful. So the user could decide if they want the value updated
-when the device changed , and also when nodered starts.
-when the device changed, but NOT when nodered starts.
-when the device update , and also when nodered starts.
-When the device update, but NOT when nodered starts.
The text was updated successfully, but these errors were encountered: