node-red-contrib-presence-faker
node-red-contrib-presence-faker copied to clipboard
Feature request: Save entity state before, restore after
Love this! Would you please consider adding the following capability? It would be useful to remember the entity's state prior to enabling presence faker then restore the state afterwards. So "when disabled" there would be a new option of "restore to initial state" in addition to "turn on", "turn off", "do nothing".
Hi @windsurferwill,
Thanks for reaching out! Just to make sure I understand your suggestion correctly: How do you envision presence faker to know a device's state prior to enabling it?
I really appreciate you reaching out.
I'm was thinking of the functionality of the 'on-the-fly' Scenes functionality per https://www.home-assistant.io/integrations/scene/ which captures the current state of a set of entities and allows you to restore them as well. Would something like this help?
https://community.home-assistant.io/t/fetch-entity-state-in-a-function-node/174613/6
Steve
I think if I were doing this in node-red as a node function I'd use something like the 'current_state' node.
One possible way of going about this could be to feed all device state changes as they happen into the presence-faker node for it to remember it, so that once the end of a schedule has come, it can emit the appropriate final msg.
It would be good if presence-faker could somehow "query" a device's state before a schedule starts, but as far as I know, this is not how Node-RED works.