dummylabs / thewatchman

Home Assistant custom integration to keep track of missing entities and actions in your config files
MIT License
475 stars 20 forks source link

Check entities used in Node-RED #84

Open Senbei123 opened 1 year ago

Senbei123 commented 1 year ago

Hi,

it would be perfect if you can adapt this check also for automations in Node-RED. The issue could be, that the file is in a json-format, not a yaml file.

Following an example flow in json:

as you will see, there are points like entityId":["light.bad_stripe"]

[{"id":"9f768ba5b2cc51c5","type":"comment","z":"35de99a5f60b0429","name":"Licht auf 100% zw. 8-10 Uhr mit Lichtstärke vorher merken","info":"","x":270,"y":1200,"wires":[]},{"id":"1c64fc86c854732b","type":"server-state-changed","z":"35de99a5f60b0429","name":"Bewegung erkannt","server":"5a3777c7.b71588","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.bad_bewegung","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"on","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":true,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":130,"y":1320,"wires":[["75def67488700c02"],[]]},{"id":"9e73b5e4c459249f","type":"time-range-switch","z":"35de99a5f60b0429","name":"8-10","lat":"51.66544","lon":"7.18092","startTime":"08:00","endTime":"10:00","startOffset":0,"endOffset":0,"x":730,"y":1320,"wires":[["7535c21869c150d7"],[]]},{"id":"7535c21869c150d7","type":"api-call-service","z":"35de99a5f60b0429","name":"Badlicht auf 100%","server":"5a3777c7.b71588","version":5,"debugenabled":false,"domain":"light","service":"turn_on","areaId":[],"deviceId":[],"entityId":["light.bad_stripe"],"data":"{\"transition\":\"2\"}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":950,"y":1320,"wires":[["770508e2e42bb3c0"]]},{"id":"b3fb67d4d32d0378","type":"inject","z":"35de99a5f60b0429","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":120,"y":1240,"wires":[["75def67488700c02"]]},{"id":"b689732c42bcb92f","type":"change","z":"35de99a5f60b0429","name":"Speicher Helligkeit","rules":[{"t":"set","p":"helligkeit","pt":"flow","to":"data.attributes.brightness","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":570,"y":1320,"wires":[["9e73b5e4c459249f"]]},{"id":"75def67488700c02","type":"api-current-state","z":"35de99a5f60b0429","name":"Status Bad Stripe","server":"5a3777c7.b71588","version":3,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"light.bad_stripe","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":350,"y":1320,"wires":[["b689732c42bcb92f"]]},{"id":"770508e2e42bb3c0","type":"delay","z":"35de99a5f60b0429","name":"","pauseType":"delay","timeout":"2","timeoutUnits":"minutes","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":160,"y":1420,"wires":[["9b68bf211541a332"]]},{"id":"9b68bf211541a332","type":"api-call-service","z":"35de99a5f60b0429","name":"Badlicht zurücksetzen","server":"5a3777c7.b71588","version":5,"debugenabled":false,"domain":"light","service":"turn_on","areaId":[],"deviceId":[],"entityId":["light.bad_stripe"],"data":"{\"transition\":\"2\";\"brightness\":{{flow.helligkeit}}}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":420,"y":1420,"wires":[[]]},{"id":"5a3777c7.b71588","type":"server","name":"Home Assistant","version":5,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":false,"cacheJson":true,"heartbeat":false,"heartbeatInterval":"30","areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":"at: ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"h23","statusTimeFormat":"h:m","enableGlobalContextStore":true}]

HaraldGithub commented 1 year ago

Hi, I would appreciate if you'll add the Node-Red-Check, too. At the moment, there is a work around to convert Node-Red-json-file to yaml-file here: https://www.json2yaml.com and than store it in an extra folder in configuration.yaml, than watchman checks this folder, too. But you have to repeat this procedure after each node-red-change, so it would be nice, if watchman will check node-red be itself. Thank you in advance for solving this problem or better improve your tool.

dflvunoooooo commented 1 year ago

Hi, I would appreciate if you'll add the Node-Red-Check, too. At the moment, there is a work around to convert Node-Red-json-file to yaml-file here: https://www.json2yaml.com and than store it in an extra folder in configuration.yaml, than watchman checks this folder, too. But you have to repeat this procedure after each node-red-change, so it would be nice, if watchman will check node-red be itself. Thank you in advance for solving this problem or better improve your tool.

How did you manage to convert your Node-Red flow there? If I insert my config it says something about an non whitespace character.

HaraldGithub commented 1 year ago

I've seen a video on YT (maybe unfortunately in German): Simon explain in this video how to do this. Please check here: https://www.youtube.com/watch?v=V5weouF2l1I&t=371s Look up 06:16 min.

dflvunoooooo commented 1 year ago

Thank you very much. As a workaround we can do this with Node-Red. I created an automation inside Node-Red to convert its flows.jason to a yaml file inside the node-red folder and store it as a new file called flows-for-watchman.yaml. Which then will be read by Watchman. If you configure watchman with a 60 seconds delay, it will even update this after a reboot. Here is my Node-Red flow to do just that.

Edit: I had to adjust it to wait a bit after startup.

Screenshot_20230317_103129

[{"id":"960214bb667c5ba1","type":"file","z":"a8ffa049.78d408","name":"","filename":"/config/node-red/flows-for-watchman.yaml","filenameType":"str","appendNewline":true,"createDir":false,"overwriteFile":"true","encoding":"none","x":1040,"y":4840,"wires":[[]]},{"id":"8143e12a9a16383b","type":"yaml","z":"a8ffa049.78d408","property":"payload","name":"","x":790,"y":4840,"wires":[["960214bb667c5ba1"]]},{"id":"ecc3c6466cacdc5d","type":"json","z":"a8ffa049.78d408","name":"","property":"payload","action":"","pretty":false,"x":650,"y":4840,"wires":[["8143e12a9a16383b"]]},{"id":"8b2eb5ef87a33a42","type":"file in","z":"a8ffa049.78d408","name":"","filename":"/config/node-red/flows.json","filenameType":"str","format":"utf8","chunk":false,"sendError":false,"encoding":"none","allProps":false,"x":440,"y":4840,"wires":[["ecc3c6466cacdc5d"]]},{"id":"879be01db70658c0","type":"inject","z":"a8ffa049.78d408","name":"Output 30s after connect","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":"30","topic":"output on connect","payload":"true","payloadType":"str","x":170,"y":4840,"wires":[["8b2eb5ef87a33a42","1ef7974a8dd1d015"]]}]
HaraldGithub commented 1 year ago

Thank you very much! I'll try your flow within the next days and will report here. It works fine for me. I've changed the path for "flows-for-watchman" to config/ and changed the name to "flows_for_watchman". And found 6 missing entities!

dflvunoooooo commented 1 year ago

Thank you very much! I'll try your flow within the next days and will report here. It works fine for me. I've changed the path for "flows-for-watchman" to config/ and changed the name to "flows_for_watchman". And found 6 missing entities!

You're welcome. Great that it works. :)

HaraldGithub commented 1 year ago

Hi,

have you seen my request an watchman page here:

https://github.com/dummylabs/thewatchman/issues/100#issue-1836144598

What do you think, is there a possibility to fit this request with a node red function?

BTW: Your node red flow to check node red flows too works very well!

Best regards

Harald

Von: dflvunoooooo @.> Antworten an: dummylabs/thewatchman @.> Datum: Donnerstag, 16. März 2023 um 11:57 An: dummylabs/thewatchman @.> Cc: HaraldGithub @.>, Comment @.***> Betreff: Re: [dummylabs/thewatchman] Check entities used in Node-RED (Issue #84)

Thank you very much. With that and Node-Red it is easy to create an automation inside Node-Red to convert its flows.jason to a yaml file and store it as a new file. Which then will be read by Watchman. Here is my Node-Red flow to do just that. [{"id":"8b2eb5ef87a33a42","type":"file in","z":"23e9b7f2.4a3b38","name":"","filename":"/config/node-red/flows.json","filenameType":"str","format":"utf8","chunk":false,"sendError":false,"encoding":"none","allProps":false,"x":400,"y":740,"wires":[["ecc3c6466cacdc5d"]]},{"id":"ecc3c6466cacdc5d","type":"json","z":"23e9b7f2.4a3b38","name":"","property":"payload","action":"","pretty":false,"x":610,"y":740,"wires":[["8143e12a9a16383b"]]},{"id":"8143e12a9a16383b","type":"yaml","z":"23e9b7f2.4a3b38","property":"payload","name":"","x":750,"y":740,"wires":[["960214bb667c5ba1"]]},{"id":"960214bb667c5ba1","type":"file","z":"23e9b7f2.4a3b38","name":"","filename":"/config/node-red/flows-for-watchman.yaml","filenameType":"str","appendNewline":true,"createDir":false,"overwriteFile":"true","encoding":"none","x":1000,"y":740,"wires":[[]]},{"id":"879be01db70658c0","type":"inject","z":"23e9b7f2.4a3b38","name":"Output on connect","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":"5","topic":"output on connect","payload":"true","payloadType":"str","x":150,"y":740,"wires":[["8b2eb5ef87a33a42"]]}] — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

HaraldGithub commented 1 year ago

Hi,

yesterday was an update to node-red 16.0.2 bei @frenck from NabCasa.

Unfortunately they’ve changed the directory for the flows to a location outside configuration.

More details here:

https://github.com/hassio-addons/addon-node-red/issues/1736#issuecomment-1812437543

I haven’t found a solution, that the flow-check works again with watchman.

Would you please so kind to check this facts and I would appreciate, if you’ll find a solution.

Best regards

Harald

Von: dflvunoooooo @.> Antworten an: dummylabs/thewatchman @.> Datum: Donnerstag, 16. März 2023 um 11:57 An: dummylabs/thewatchman @.> Cc: HaraldGithub @.>, Comment @.***> Betreff: Re: [dummylabs/thewatchman] Check entities used in Node-RED (Issue #84)

Thank you very much. With that and Node-Red it is easy to create an automation inside Node-Red to convert its flows.jason to a yaml file and store it as a new file. Which then will be read by Watchman. Here is my Node-Red flow to do just that. [{"id":"8b2eb5ef87a33a42","type":"file in","z":"23e9b7f2.4a3b38","name":"","filename":"/config/node-red/flows.json","filenameType":"str","format":"utf8","chunk":false,"sendError":false,"encoding":"none","allProps":false,"x":400,"y":740,"wires":[["ecc3c6466cacdc5d"]]},{"id":"ecc3c6466cacdc5d","type":"json","z":"23e9b7f2.4a3b38","name":"","property":"payload","action":"","pretty":false,"x":610,"y":740,"wires":[["8143e12a9a16383b"]]},{"id":"8143e12a9a16383b","type":"yaml","z":"23e9b7f2.4a3b38","property":"payload","name":"","x":750,"y":740,"wires":[["960214bb667c5ba1"]]},{"id":"960214bb667c5ba1","type":"file","z":"23e9b7f2.4a3b38","name":"","filename":"/config/node-red/flows-for-watchman.yaml","filenameType":"str","appendNewline":true,"createDir":false,"overwriteFile":"true","encoding":"none","x":1000,"y":740,"wires":[[]]},{"id":"879be01db70658c0","type":"inject","z":"23e9b7f2.4a3b38","name":"Output on connect","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":"5","topic":"output on connect","payload":"true","payloadType":"str","x":150,"y":740,"wires":[["8b2eb5ef87a33a42"]]}] — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

dflvunoooooo commented 1 year ago

Hi, yesterday was an update to node-red 16.0.2 bei @frenck from NabCasa. Unfortunately they’ve changed the directory for the flows to a location outside configuration. More details here: hassio-addons/addon-node-red#1736 (comment) I haven’t found a solution, that the flow-check works again with watchman. Would you please so kind to check this facts and I would appreciate, if you’ll find a solution. Best regards Harald Von: dflvunoooooo @.> Antworten an: dummylabs/thewatchman @.> Datum: Donnerstag, 16. März 2023 um 11:57 An: dummylabs/thewatchman @.> Cc: HaraldGithub @.>, Comment @.> Betreff: Re: [dummylabs/thewatchman] Check entities used in Node-RED (Issue #84) Thank you very much. With that and Node-Red it is easy to create an automation inside Node-Red to convert its flows.jason to a yaml file and store it as a new file. Which then will be read by Watchman. Here is my Node-Red flow to do just that. [{"id":"8b2eb5ef87a33a42","type":"file in","z":"23e9b7f2.4a3b38","name":"","filename":"/config/node-red/flows.json","filenameType":"str","format":"utf8","chunk":false,"sendError":false,"encoding":"none","allProps":false,"x":400,"y":740,"wires":[["ecc3c6466cacdc5d"]]},{"id":"ecc3c6466cacdc5d","type":"json","z":"23e9b7f2.4a3b38","name":"","property":"payload","action":"","pretty":false,"x":610,"y":740,"wires":[["8143e12a9a16383b"]]},{"id":"8143e12a9a16383b","type":"yaml","z":"23e9b7f2.4a3b38","property":"payload","name":"","x":750,"y":740,"wires":[["960214bb667c5ba1"]]},{"id":"960214bb667c5ba1","type":"file","z":"23e9b7f2.4a3b38","name":"","filename":"/config/node-red/flows-for-watchman.yaml","filenameType":"str","appendNewline":true,"createDir":false,"overwriteFile":"true","encoding":"none","x":1000,"y":740,"wires":[[]]},{"id":"879be01db70658c0","type":"inject","z":"23e9b7f2.4a3b38","name":"Output on connect","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":"5","topic":"output on connect","payload":"true","payloadType":"str","x":150,"y":740,"wires":[["8b2eb5ef87a33a42"]]}] — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.>

Unfortunately this seems to be intended. I filed an issue yesterday and it was closed as not planned immediately, see here.

HaraldGithub commented 1 year ago

Hi,

not good.

Maybe a solution is, to copy the “flow”-file via termina to a folder inside configuration automaticly.

I’ve tried, but the “check”-node can’t find my copied file.

Any ideas?

Harald

Von: dflvunoooooo @.> Antworten an: dummylabs/thewatchman @.> Datum: Donnerstag, 16. November 2023 um 13:49 An: dummylabs/thewatchman @.> Cc: HaraldGithub @.>, Comment @.***> Betreff: Re: [dummylabs/thewatchman] Check entities used in Node-RED (Issue #84)

Hi, yesterday was an update to node-red 16.0.2 bei @frenck from NabCasa. Unfortunately they’ve changed the directory for the flows to a location outside configuration. More details here: hassio-addons/addon-node-red#1736 (comment) I haven’t found a solution, that the flow-check works again with watchman. Would you please so kind to check this facts and I would appreciate, if you’ll find a solution. Best regards Harald Von: dflvunoooooo @.> Antworten an: dummylabs/thewatchman @.> Datum: Donnerstag, 16. März 2023 um 11:57 An: dummylabs/thewatchman @.> Cc: HaraldGithub @.>, Comment @.> Betreff: Re: [dummylabs/thewatchman] Check entities used in Node-RED (Issue #84) Thank you very much. With that and Node-Red it is easy to create an automation inside Node-Red to convert its flows.jason to a yaml file and store it as a new file. Which then will be read by Watchman. Here is my Node-Red flow to do just that. [{"id":"8b2eb5ef87a33a42","type":"file in","z":"23e9b7f2.4a3b38","name":"","filename":"/config/node-red/flows.json","filenameType":"str","format":"utf8","chunk":false,"sendError":false,"encoding":"none","allProps":false,"x":400,"y":740,"wires":[["ecc3c6466cacdc5d"]]},{"id":"ecc3c6466cacdc5d","type":"json","z":"23e9b7f2.4a3b38","name":"","property":"payload","action":"","pretty":false,"x":610,"y":740,"wires":[["8143e12a9a16383b"]]},{"id":"8143e12a9a16383b","type":"yaml","z":"23e9b7f2.4a3b38","property":"payload","name":"","x":750,"y":740,"wires":[["960214bb667c5ba1"]]},{"id":"960214bb667c5ba1","type":"file","z":"23e9b7f2.4a3b38","name":"","filename":"/config/node-red/flows-for-watchman.yaml","filenameType":"str","appendNewline":true,"createDir":false,"overwriteFile":"true","encoding":"none","x":1000,"y":740,"wires":[[]]},{"id":"879be01db70658c0","type":"inject","z":"23e9b7f2.4a3b38","name":"Output on connect","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":"5","topic":"output on connect","payload":"true","payloadType":"str","x":150,"y":740,"wires":[["8b2eb5ef87a33a42"]]}] — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.>

Unfortunately this seems to be intended. I filed an issue yesterday and it was closed as not planned immediately, see here.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

dflvunoooooo commented 1 year ago

As I understand it, the change with 16.0.2 to move Node-Red files in a separate folder is to prohibit access to those files. I do not see, how this can be achieved.

HaraldGithub commented 1 year ago

Hi,

I could see this folder via ssh-access on my mac.

I’ve copy the file from this folder to a node-red-folder in config/, but your “old” solution can’t read/find this file.

Harald

Von: dflvunoooooo @.> Antworten an: dummylabs/thewatchman @.> Datum: Donnerstag, 16. November 2023 um 14:12 An: dummylabs/thewatchman @.> Cc: HaraldGithub @.>, Comment @.***> Betreff: Re: [dummylabs/thewatchman] Check entities used in Node-RED (Issue #84)

As I understand it, the change with 16.0.2 to move Node-Red files in a separate folder is to prohibit access to those files. I do not see, how this can be achieved.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

dflvunoooooo commented 1 year ago

This may be an issue with file permissions. You can check this with ls -la.

HaraldGithub commented 1 year ago

Sorry, what do you mean with 1s  -1a?

Von: dflvunoooooo @.> Antworten an: dummylabs/thewatchman @.> Datum: Donnerstag, 16. November 2023 um 14:39 An: dummylabs/thewatchman @.> Cc: HaraldGithub @.>, Comment @.***> Betreff: Re: [dummylabs/thewatchman] Check entities used in Node-RED (Issue #84)

This may be an issue with file permissions. You can check this with ls -la.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

HaraldGithub commented 1 year ago

Here a copy of my config/

And here my/your node:

And here the error message:

Von: dflvunoooooo @.> Antworten an: dummylabs/thewatchman @.> Datum: Donnerstag, 16. November 2023 um 14:39 An: dummylabs/thewatchman @.> Cc: HaraldGithub @.>, Comment @.***> Betreff: Re: [dummylabs/thewatchman] Check entities used in Node-RED (Issue #84)

This may be an issue with file permissions. You can check this with ls -la.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

dflvunoooooo commented 1 year ago

Sorry, what do you mean with 1s -1a? Von: dflvunoooooo @.> Antworten an: dummylabs/thewatchman @.> Datum: Donnerstag, 16. November 2023 um 14:39 An: dummylabs/thewatchman @.> Cc: HaraldGithub @.>, Comment @.> Betreff: Re: [dummylabs/thewatchman] Check entities used in Node-RED (Issue #84) This may be an issue with file permissions. You can check this with ls -la. — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.>

Those are not numbers but letters. The twelve-th letter in the alphabet.

Here you can read about file permissions in linux. They should be the same as in the folder you copied the files into. But this is only a guess, I haven't tried it myself.

HaraldGithub commented 1 year ago

I’ve found a solution, based on an other bug in the ALEXA/AMAZON-Integration (apfelstrudel) in Node-Red.

The solution is, you’ve to change path this two nodes:

[{"id":"8b2eb5ef87a33a42","type":"file in","z":"9389c3c63e90a9d2","name":"Flows lesen","filename":"/homeassistant/node-red/flows.json","filenameType":"str","format":"utf8","chunk":false,"sendError":false,"encoding":"none","allProps":false,"x":350,"y":4900,"wires":[["ecc3c6466cacdc5d"]]}]

And

[{"id":"960214bb667c5ba1","type":"file","z":"9389c3c63e90a9d2","name":"Node_Red_Flows","filename":"/homeassistant/flows_for_watchman.yaml","filenameType":"str","appendNewline":true,"createDir":false,"overwriteFile":"true","encoding":"none","x":650,"y":4840,"wires":[["eef1a3c5bac66536"]]}]

To: /homeassostant/node-red/flows.json     or /homeassistant/flows_forwatchman.yam

That’s all!

Have an nice weekend!

Harry

Von: dflvunoooooo @.> Antworten an: dummylabs/thewatchman @.> Datum: Donnerstag, 16. November 2023 um 14:59 An: dummylabs/thewatchman @.> Cc: HaraldGithub @.>, Comment @.***> Betreff: Re: [dummylabs/thewatchman] Check entities used in Node-RED (Issue #84)

Sorry, what do you mean with 1s -1a? Von: dflvunoooooo @.> Antworten an: dummylabs/thewatchman @.> Datum: Donnerstag, 16. November 2023 um 14:39 An: dummylabs/thewatchman @.> Cc: HaraldGithub @.>, Comment @.> Betreff: Re: [dummylabs/thewatchman] Check entities used in Node-RED (Issue #84) This may be an issue with file permissions. You can check this with ls -la. — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.>

Those are not numbers but letters. The twelve-th letter in the alphabet.

Here you can read about file permissions in linux. They should be the same as in the folder you copied the files into. But this is only a guess, I haven't tried it myself.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

dflvunoooooo commented 1 year ago

I’ve found a solution, based on an other bug in the ALEXA/AMAZON-Integration (apfelstrudel) in Node-Red. The solution is, you’ve to change path this two nodes: [{"id":"8b2eb5ef87a33a42","type":"file in","z":"9389c3c63e90a9d2","name":"Flows lesen","filename":"/homeassistant/node-red/flows.json","filenameType":"str","format":"utf8","chunk":false,"sendError":false,"encoding":"none","allProps":false,"x":350,"y":4900,"wires":[["ecc3c6466cacdc5d"]]}] And [{"id":"960214bb667c5ba1","type":"file","z":"9389c3c63e90a9d2","name":"Node_Red_Flows","filename":"/homeassistant/flows_for_watchman.yaml","filenameType":"str","appendNewline":true,"createDir":false,"overwriteFile":"true","encoding":"none","x":650,"y":4840,"wires":[["eef1a3c5bac66536"]]}] To: /homeassostant/node-red/flows.json or /homeassistant/flows_forwatchman.yam That’s all! Have an nice weekend! Harry Von: dflvunoooooo @.> Antworten an: dummylabs/thewatchman @.> Datum: Donnerstag, 16. November 2023 um 14:59 An: dummylabs/thewatchman @.> Cc: HaraldGithub @.>, Comment @.> Betreff: Re: [dummylabs/thewatchman] Check entities used in Node-RED (Issue #84) Sorry, what do you mean with 1s -1a? Von: dflvunoooooo @.> Antworten an: dummylabs/thewatchman @.> Datum: Donnerstag, 16. November 2023 um 14:39 An: dummylabs/thewatchman @.> Cc: HaraldGithub @.>, Comment @.> Betreff: Re: [dummylabs/thewatchman] Check entities used in Node-RED (Issue #84) This may be an issue with file permissions. You can check this with ls -la. — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.> Those are not numbers but letters. The twelve-th letter in the alphabet. Here you can read about file permissions in linux. They should be the same as in the folder you copied the files into. But this is only a guess, I haven't tried it myself. — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.>

That sounds promising, thank you. Sadly it does not work for me, still get the error, that "Error: ENOENT: no such file or directory, open '/homeassistant/node-red/flows.json'". Can you please provide a link to the issue on ALEXA/AMAZON-Integration?

HaraldGithub commented 1 year ago

Sure!

https://github.com/bbindreiter/node-red-contrib-alexa-remote2-applestrudel/issues/163

Here in addition my configuration:

Reading flows:

Writing flows-for-watchman:

Good luck!

Von: dflvunoooooo @.> Antworten an: dummylabs/thewatchman @.> Datum: Sonntag, 19. November 2023 um 14:16 An: dummylabs/thewatchman @.> Cc: HaraldGithub @.>, Comment @.***> Betreff: Re: [dummylabs/thewatchman] Check entities used in Node-RED (Issue #84)

I’ve found a solution, based on an other bug in the ALEXA/AMAZON-Integration (apfelstrudel) in Node-Red. The solution is, you’ve to change path this two nodes: [{"id":"8b2eb5ef87a33a42","type":"file in","z":"9389c3c63e90a9d2","name":"Flows lesen","filename":"/homeassistant/node-red/flows.json","filenameType":"str","format":"utf8","chunk":false,"sendError":false,"encoding":"none","allProps":false,"x":350,"y":4900,"wires":[["ecc3c6466cacdc5d"]]}] And [{"id":"960214bb667c5ba1","type":"file","z":"9389c3c63e90a9d2","name":"Node_Red_Flows","filename":"/homeassistant/flows_for_watchman.yaml","filenameType":"str","appendNewline":true,"createDir":false,"overwriteFile":"true","encoding":"none","x":650,"y":4840,"wires":[["eef1a3c5bac66536"]]}] To: /homeassostant/node-red/flows.json or /homeassistant/flows_forwatchman.yam That’s all! Have an nice weekend! Harry Von: dflvunoooooo @.> Antworten an: dummylabs/thewatchman @.> Datum: Donnerstag, 16. November 2023 um 14:59 An: dummylabs/thewatchman @.> Cc: HaraldGithub @.>, Comment @.> Betreff: Re: [dummylabs/thewatchman] Check entities used in Node-RED (Issue #84) Sorry, what do you mean with 1s -1a? Von: dflvunoooooo @.> Antworten an: dummylabs/thewatchman @.> Datum: Donnerstag, 16. November 2023 um 14:39 An: dummylabs/thewatchman @.> Cc: HaraldGithub @.>, Comment @.> Betreff: Re: [dummylabs/thewatchman] Check entities used in Node-RED (Issue #84) This may be an issue with file permissions. You can check this with ls -la. — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.> Those are not numbers but letters. The twelve-th letter in the alphabet. Here you can read about file permissions in linux. They should be the same as in the folder you copied the files into. But this is only a guess, I haven't tried it myself. — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.>

That sounds promising, thank you. Sadly it does not work for me, still get the error, that "Error: ENOENT: no such file or directory, open '/homeassistant/node-red/flows.json'". Can you please provide a link to the issue on ALEXA/AMAZON-Integration?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

dflvunoooooo commented 1 year ago

It does not work for me. The content of the folder /homeassistant/node-red gets automatically copied to /addon_configs/a0d2ga54_nodered on boot. When I copy it manually back and remove the /addon_configs/a0d2ga54_nodered folder, it is gone with the next boot. And that folder is not accessible.

Edit: Not only with a boot, but also with a Node-Red (re)start.

HaraldGithub commented 1 year ago

Okay, I’ll check after next reboot of HA (I haven’t rebooted HA since then modification I sent to you).

Von: dflvunoooooo @.> Antworten an: dummylabs/thewatchman @.> Datum: Sonntag, 19. November 2023 um 14:57 An: dummylabs/thewatchman @.> Cc: HaraldGithub @.>, Comment @.***> Betreff: Re: [dummylabs/thewatchman] Check entities used in Node-RED (Issue #84)

It does not work for me. The content of the folder /homeassistant/node-red gets automatically copied to /addon_configs/a0d2ga54_nodered on boot. When I copy it manually back and remove the /addon_configs/a0d2ga54_nodered folder, it is gone with the next boot. And that folder is not accessible.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

HaraldGithub commented 1 year ago

For me it works like this:

After changing something in any node-red-flow, I copy manually “flows.jason” form /addon_configs/a0d7b954_nodered/

direct to /config/ (not in a separate folder called node-red).

After that it works for me and a new “flows_for_watchman.yaml” appears in /config/ and is checked by watchman.

This works also after restart of HA.

The only thing I now need is an automation, that compares “flows.jason” in /addon_configs/a0d7b954_nodered/

and in /config/ and copies “flows.jason” if /addon_configs/a0d7b954_nodered/ is newer than /config/.

Best regards

Harald

Von: dflvunoooooo @.> Antworten an: dummylabs/thewatchman @.> Datum: Sonntag, 19. November 2023 um 14:57 An: dummylabs/thewatchman @.> Cc: HaraldGithub @.>, Comment @.***> Betreff: Re: [dummylabs/thewatchman] Check entities used in Node-RED (Issue #84)

It does not work for me. The content of the folder /homeassistant/node-red gets automatically copied to /addon_configs/a0d2ga54_nodered on boot. When I copy it manually back and remove the /addon_configs/a0d2ga54_nodered folder, it is gone with the next boot. And that folder is not accessible.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

dflvunoooooo commented 1 year ago

Yeah, but one has to ssh into home assistant and manually copy that file every time something gets changed in Node-Red.

HaraldGithub commented 1 year ago

Yes, that’s true, therefore I’m looking for an automation which will do this, like samba-share/backup

will do the backup of HA every night to my NAS.

SSH is not the problem, because  I’ll do it from my MacBook and at the moment, I’ll do not so many changes

in my node-red-flows.

Harald

Von: dflvunoooooo @.> Antworten an: dummylabs/thewatchman @.> Datum: Montag, 20. November 2023 um 14:16 An: dummylabs/thewatchman @.> Cc: HaraldGithub @.>, Comment @.***> Betreff: Re: [dummylabs/thewatchman] Check entities used in Node-RED (Issue #84)

Yeah, but one has to ssh into home assistant and manually copy that file every time something gets changed in Node-Red.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

dflvunoooooo commented 11 months ago

My current workaround is to ssh into home assistant from node-red and copy the file /addon_configs/a93hb954_nodered/flows.json to /config/node-red/. After that my original node-red automation is working again. I copy that file over automatically on a node-red deploy.

HaraldGithub commented 11 months ago

Hi,

that sounds very good.

I copy the file manually, if I don’t forget it. 😉

How do you realize this workaround (in HA automations or in a node-red flow)?

Do you have some more information’s for me, so that copy this workaround?

Thank you in advance!

Harald

Von: dflvunoooooo @.> Antworten an: dummylabs/thewatchman @.> Datum: Mittwoch, 13. Dezember 2023 um 15:14 An: dummylabs/thewatchman @.> Cc: HaraldGithub @.>, Comment @.***> Betreff: Re: [dummylabs/thewatchman] Check entities used in Node-RED (Issue #84)

My current workaround is to ssh into home assistant from node-red and copy the file /addon_configs/a93hb954_nodered/flows.json to /config/node-red/. After that my original node-red automation is working again. I copy that file over automatically on a node-red deploy.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

dflvunoooooo commented 11 months ago

It is a node-red automation. Here is my flow. But you need the ssh addon for home assistant.

[{"id":"51721b094184dd64","type":"ssh-v3","z":"a8ffa049.78d408","name":"hassio","conf":"32c41d6381b96e17","debug":false,"x":510,"y":300,"wires":[["ea59d09d212b77df"]]},{"id":"5852d669b0136559","type":"change","z":"a8ffa049.78d408","name":"cp flows.json","rules":[{"t":"set","p":"payload","pt":"msg","to":"sudo cp /addon_configs/a0d7b954_nodered/flows.json /config/node-red/","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":350,"y":300,"wires":[["51721b094184dd64"]]},{"id":"cbb0a205b798b06c","type":"inject","z":"a8ffa049.78d408","name":"Output on connect","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":"5","topic":"output on connect","payload":"true","payloadType":"str","x":150,"y":300,"wires":[["5852d669b0136559"]]},{"id":"32c41d6381b96e17","type":"ssh-conf","ssh":"","name":"hassio","userlabel":"hassio"}]

HaraldGithub commented 11 months ago

Thank you, I’ll try your flow (SSH is in my HA installed, because I use it for my backup on my NAS).

Von: dflvunoooooo @.> Antworten an: dummylabs/thewatchman @.> Datum: Mittwoch, 13. Dezember 2023 um 15:22 An: dummylabs/thewatchman @.> Cc: HaraldGithub @.>, Comment @.***> Betreff: Re: [dummylabs/thewatchman] Check entities used in Node-RED (Issue #84)

It is a node-red automation. Here is my flow. But you need the ssh addon for home assistant.

[{"id":"51721b094184dd64","type":"ssh-v3","z":"a8ffa049.78d408","name":"hassio","conf":"32c41d6381b96e17","debug":false,"x":510,"y":300,"wires":[["ea59d09d212b77df"]]},{"id":"5852d669b0136559","type":"change","z":"a8ffa049.78d408","name":"cp flows.json","rules":[{"t":"set","p":"payload","pt":"msg","to":"sudo cp /addon_configs/a0d7b954_nodered/flows.json /config/node-red/","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":350,"y":300,"wires":[["51721b094184dd64"]]},{"id":"cbb0a205b798b06c","type":"inject","z":"a8ffa049.78d408","name":"Output on connect","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":"5","topic":"output on connect","payload":"true","payloadType":"str","x":150,"y":300,"wires":[["5852d669b0136559"]]},{"id":"32c41d6381b96e17","type":"ssh-conf","ssh":"","name":"hassio","userlabel":"hassio"}]

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

HaraldGithub commented 10 months ago

Hi,

after my holiday I’ve tried your flow, but it dosen’t work for me.

First I’ve to install a new SSH-node in Node-Red, than I could implement your flow.

But with the configuration of the nodes something goes wrong.

Could you please explain me, what is “generic configuration” and what is user specific (e.g. HA-IP in my case: 172.30.32.1)

Thanks a lot!!

Harald

Von: dflvunoooooo @.> Antworten an: dummylabs/thewatchman @.> Datum: Mittwoch, 13. Dezember 2023 um 15:22 An: dummylabs/thewatchman @.> Cc: HaraldGithub @.>, Comment @.***> Betreff: Re: [dummylabs/thewatchman] Check entities used in Node-RED (Issue #84)

It is a node-red automation. Here is my flow. But you need the ssh addon for home assistant.

[{"id":"51721b094184dd64","type":"ssh-v3","z":"a8ffa049.78d408","name":"hassio","conf":"32c41d6381b96e17","debug":false,"x":510,"y":300,"wires":[["ea59d09d212b77df"]]},{"id":"5852d669b0136559","type":"change","z":"a8ffa049.78d408","name":"cp flows.json","rules":[{"t":"set","p":"payload","pt":"msg","to":"sudo cp /addon_configs/a0d7b954_nodered/flows.json /config/node-red/","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":350,"y":300,"wires":[["51721b094184dd64"]]},{"id":"cbb0a205b798b06c","type":"inject","z":"a8ffa049.78d408","name":"Output on connect","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":"5","topic":"output on connect","payload":"true","payloadType":"str","x":150,"y":300,"wires":[["5852d669b0136559"]]},{"id":"32c41d6381b96e17","type":"ssh-conf","ssh":"","name":"hassio","userlabel":"hassio"}]

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

dflvunoooooo commented 10 months ago

Yes, you have to install the ssh-palette. Do you also have the ssh plugin for HA? If so, you have to config the ssh node in Node-Red to connect to your HA instance. I am no docker expert, but I don't think the 172… IP will work, because Node-Red and HA are not in the same Docker network. I connected the ssh node to the HA IP in my home network, something like 192… After that, my flow will work. I assume, that the "generic config" is the configuration for the ssh node, but I am not sure.

HaraldGithub commented 10 months ago

Thanks, I’ll try (and I’ve no docker installation).

Von: dflvunoooooo @.> Antworten an: dummylabs/thewatchman @.> Datum: Mittwoch, 24. Januar 2024 um 16:04 An: dummylabs/thewatchman @.> Cc: Harald @.>, Comment @.***> Betreff: Re: [dummylabs/thewatchman] Check entities used in Node-RED (Issue #84)

Yes, you have to install the ssh-palette. Do you also have the ssh plugin for HA? If so, you have to config the ssh node in Node-Red to connect to your HA instance. I am no docker expert, but I don't think the 172… IP will work, because Node-Red and HA are not in the same Docker network. I connected the ssh node to the HA IP in my home network, something like 192… After that, my flow will work. I assume, that the "generic config" is the configuration for the ssh node, but I am not sure.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

HaraldGithub commented 9 months ago

Hi,

I’ve tryed some day’s, but now it works.

But without “sudo” in “change”-node

[{"id":"5852d669b0136559","type":"change","z":"9389c3c63e90a9d2","name":"cp flows.json","rules":[{"t":"set","p":"payload","pt":"msg","to":"cp /addon_configs/a0d7b954_nodered/flows.json /config/","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":361,"y":5156,"wires":[["9af74b07a8be600d"]]}]

Thank you for your support!

Best regards!

Harald

Von: dflvunoooooo @.> Antworten an: dummylabs/thewatchman @.> Datum: Mittwoch, 24. Januar 2024 um 16:04 An: dummylabs/thewatchman @.> Cc: Harald @.>, Comment @.***> Betreff: Re: [dummylabs/thewatchman] Check entities used in Node-RED (Issue #84)

Yes, you have to install the ssh-palette. Do you also have the ssh plugin for HA? If so, you have to config the ssh node in Node-Red to connect to your HA instance. I am no docker expert, but I don't think the 172… IP will work, because Node-Red and HA are not in the same Docker network. I connected the ssh node to the HA IP in my home network, something like 192… After that, my flow will work. I assume, that the "generic config" is the configuration for the ssh node, but I am not sure.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

dflvunoooooo commented 9 months ago

Hi, I’ve tryed some day’s, but now it works. But without “sudo” in “change”-node

You are very welcome.

HaraldGithub commented 2 months ago

Hi,

sorry for another contact.

Your flow: copy via ssh “flows.json” form addon-folder to config stopped working, and I don’t know why.

SSH is connected

Here is my/your flow:

[{"id":"9af74b07a8be600d","type":"ssh-v3","z":"9389c3c63e90a9d2","name":"SSH: Flow.json => config","conf":"37be7cdb67159e80","debug":false,"x":900.6666412353516,"y":5166.000205039978,"wires":[[]]},{"id":"5852d669b0136559","type":"change","z":"9389c3c63e90a9d2","name":"cp flows.json","rules":[{"t":"set","p":"payload","pt":"msg","to":"cp /addon_configs/a0d7b954_nodered/flows.json  /config/","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":672.6666412353516,"y":5166.000205039978,"wires":[["9af74b07a8be600d"]]},{"id":"cbb0a205b798b06c","type":"inject","z":"9389c3c63e90a9d2","name":"Output on connect","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"58 23 *","once":true,"onceDelay":"5","topic":"output on connect","payload":"true","payloadType":"str","x":472.66664123535156,"y":5166.000205039978,"wires":[["5852d669b0136559"]]},{"id":"37be7cdb67159e80","type":"ssh-conf","ssh":"","name":"SSH","userlabel":"SSH"}]

Do you have any idea, why it stopped working (without any error message)?

Thank you in advance for replay!

Harald

Von: dflvunoooooo @.> Antworten an: dummylabs/thewatchman @.> Datum: Mittwoch, 24. Januar 2024 um 16:04 An: dummylabs/thewatchman @.> Cc: Harald @.>, Comment @.***> Betreff: Re: [dummylabs/thewatchman] Check entities used in Node-RED (Issue #84)

Yes, you have to install the ssh-palette. Do you also have the ssh plugin for HA? If so, you have to config the ssh node in Node-Red to connect to your HA instance. I am no docker expert, but I don't think the 172… IP will work, because Node-Red and HA are not in the same Docker network. I connected the ssh node to the HA IP in my home network, something like 192… After that, my flow will work. I assume, that the "generic config" is the configuration for the ssh node, but I am not sure.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

dflvunoooooo commented 2 months ago

I have no idea why it stoppt for you. It is still working in my setup.