lopelex / node-red-contrib-harmony

Node-RED integration for Harmony hub
MIT License
13 stars 6 forks source link

Delivery of the current activity? #22

Open GerdBlomb opened 3 years ago

GerdBlomb commented 3 years ago

Hi!

As far as i can see, i can only get the new / upcoming activity of the hub. But i would like to see from which activity (even Activity "off" / "-1") the hub changes to the new activity.

Is this somehow possible with the current version? If not maybe it is possible to extent the msg object to have "current activity" and "new activity" in it?

Best regards!

lopelex commented 3 years ago

https://nodered.org/docs/user-guide/context https://nodered.org/docs/user-guide/writing-functions#storing-data Use context to save previous activity.

GerdBlomb commented 3 years ago

I know. But why? If Harmony can deliverys this and you can trust on it even after days or weeks or beetween shutdowns?

Here is an example from a Home Assistant node (which i can not make use of) what is possible: bild_5

lopelex commented 3 years ago

One possibility would be to write the context in a file. https://nodered.org/docs/api/context/store/localfilesystem

lopelex commented 3 years ago

Bildschirmfoto 2021-04-09 um 18 51 22

I think everything you need is already there, right?

GerdBlomb commented 3 years ago

Hi lopelex,

thanks for you additional hints. I think one can handle it that way. My fear is that over some days of not using the systems may divide each other. Thinking about a reboot or downtime of the node red server where in the meantime state changes on the harmony hub.

Therefore i think it will be best to trieve the actual information out of the hub. As far as i understood it is there and it is possible to query it when things change there.

Maybe in a later version of the nodes ;)

Anyway thanks!