windkh / node-red-contrib-shelly

Shelly control nodes for node red.
MIT License
33 stars 21 forks source link

Error in executeCommand1 #168

Open I-am-a-node opened 1 month ago

I-am-a-node commented 1 month ago

Hi, I don't know if this error message has a connection to any of the latest versions released. I have never seen this before and suddenly it pops up after the upgrading to v 10.28.1.

Versions: I've seen there has been a few updates lately so might have missed one and cant say exactly the exact version that might have brought this. At the same time I am looking at others reasons what that might be.

The error message is random in blocks, meaning I have 6 nodes in a flow on one computer. All 6 produces the error message at the same time. Also have 1 test flow with 2 nodes installed in a testing environment on another linux computer, same thing there. Could be random or when deploying after another change. However have been using "Modified Nodes" .

Question. Do I have to open all previously added nodes and close with DONE and DEPLOY to catch a new setting? As if I made a new change to a setting? Meaning the settings has to be kind of updated with something new that you've added to the node?

I'll keep an eye on this and see if I can see a pattern.

Edit/update 23rd July 2024. There seem to be plenty more of those error messages. Listing them below. Never seen these before. All from the different kinds of units. EM, Plug, Plus 1 PM, 1PM Mini, Dimmer 2.

Edit/update 24th July 2024. Did a check on my network thinking there was a connectivity issue. However, nothing has changed with the network lately. Did a restart to see if there as a change in behaviour and how they stay connected. Created a setup up with testing during the night but could not find any fault. Also no firmware has been changed on any of they Shellys. The only thing that has changed is the update of the Shelly nodes in Node-Red.

I'll have to create my own setup with config using the a flow with api to avoid using the Shelly node so and hope I wont get these errors as they are causing issues to my system.

Error message:

"Error in executeCommand1: /status --> AxiosError: timeout of 5012ms exceeded"

"Error in executeCommand2: /rpc/Shelly.GetStatus --> AxiosError: timeout of 5022ms exceeded"

reini12345 commented 1 month ago

same for me. Additionally i get "Error: read ECONNRESET" for some gen2 device nodes e.g. after sending an on or off command to the node

windkh commented 1 month ago

@reini12345 can you test one of the examples if it works then?

reini12345 commented 1 month ago

i use this code in a function node to switch a shelly1plus off:

msg.payload = {
    method: "Switch.Set",
    parameters: {
        id: 0,
        on: false,
    }
};
return msg;

the code itself is working fine and the shelly is switching off. But i get the error message and no output of the shelly node

windkh commented 1 month ago

I am currently not at home. Will check it out when I am back.

I-am-a-node commented 1 month ago

@reini12345 I will untick both "status output" options to get rid of all the error messages (hoping this works). Not ideal but don't think I have a choice if I don't want to get flooded with errors. I'm pretty sure I've unticked them before and when updated the pervious setting has gone back to default.

If you have the time. Please let me know if it works when sending your commands? I will run with this for about 24 hours to see if it helps.

UPDATE 17th Aug 2024 Unticking the "status" wasn't a solution. Still getting flooded with error messages.

Untick

reini12345 commented 1 month ago

@I-am-a-node deactivate these options is not a valid option for me, because i need it to save the status in an influxdb and sending the status with pushover

image

I-am-a-node commented 1 month ago

@reini12345 Thanks for your reply. Yea, kind if figured that you're using the status in your function. Think it might be the users who does need it for propose that get annoyed by these errors.

Curious if this is down to a programming structure, a change in the Axios libraries, or if it's only down to poor connection within the home network. If that is the case it would be good to have the option to set/change the timeout. Now I am trying to figure out if this issue has any other implication on my functions. To see how I can capture an error and implement this into the function to re-do a manual action to repair, ensure the event/action gets the data/push the action when an error occurs.

I-am-a-node commented 1 month ago

@windkh let me know if you need any additional information from us regarding experiences from using the node. Or if you want help with testing. My programming skills are limited so... hope I can help with providing info and/or testing.

windkh commented 1 month ago

A sample flow would be useful so that I can reproduce it. Will fix it after my vacation

reini12345 commented 1 month ago

@windkh no problem:

[{"id":"d7b3ff9c5ae8cffd","type":"function","z":"7947c8eb71b89e19","g":"de33c669c2e86fc3","name":"","func":"msg.payload = msg.payload.switch0.output;\nreturn msg;","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":420,"y":4600,"wires":[["1718314b51346f2d","87695cbacdf4750e"]]},{"id":"0a4878cb293c140b","type":"debug","z":"7947c8eb71b89e19","g":"de33c669c2e86fc3","name":"debug 150","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":430,"y":4640,"wires":[]},{"id":"2fb57078ce6ffbfe","type":"function","z":"7947c8eb71b89e19","g":"de33c669c2e86fc3","name":"UG.Keller.Aussen.Lampe off","func":"msg.payload = {\n method: \"Switch.Set\",\n parameters: {\n id: 0,\n on: false,\n }\n};\nreturn msg;","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":560,"y":4540,"wires":[["a76ba26b08a34d69"]]},{"id":"0d502437e6d4a08e","type":"inject","z":"7947c8eb71b89e19","g":"de33c669c2e86fc3","name":"UG.Keller.Aussen.Lampe.AutoAus.Uhrzeit","props":[{"p":"payload"}],"repeat":"","crontab":"00 02 * * *","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":230,"y":4540,"wires":[["2fb57078ce6ffbfe"]]},{"id":"a76ba26b08a34d69","type":"shelly-gen2","z":"7947c8eb71b89e19","g":"de33c669c2e86fc3","hostname":"192.168.178.128","description":"UG.Keller.Aussen.Lampe ","mode":"polling","verbose":false,"server":"","outputmode":"event","uploadretryinterval":5000,"pollinginterval":"3600000","pollstatus":true,"getstatusoncommand":true,"devicetype":"Relay","devicetypemustmatchexactly":false,"outputs":1,"x":190,"y":4600,"wires":[["d7b3ff9c5ae8cffd","0a4878cb293c140b"]]}]

windkh commented 1 month ago

same for me. Additionally i get "Error: read ECONNRESET" for some gen2 device nodes e.g. after sending an on or off command to the node

this is fixed in 10.28.2 (see #172)

I-am-a-node commented 3 weeks ago

@reini12345 Did this get solved for you? I still get get flooded with the error messages.

I-am-a-node commented 3 weeks ago

@windkh Hi, I wonder if mange to find anything on the matter of the "AxiosError: timeout" error messages?

Would like to continue using your node. However I still get flooded and am drowning in these error messages. Have tried different ways of not getting them. Stopped using the "pull" function + unticked the status messages and tried to request data by an inject node. However that doesn't help.

windkh commented 3 weeks ago

I did some changes, but I still need some testing... did nothing change with the last release?

I-am-a-node commented 3 weeks ago

@windkh Oki. Thank you for getting back on this. Appreciate that you're taking your time looking into this. Let me know if you need any help.

reini12345 commented 2 weeks ago

@reini12345 Did this get solved for you? I still get get flooded with the error messages.

Yes, this error has been fixed. But I still have Axios Errors with restarting NodeRed and EHOSTUNREACH Errors, although the devices can be reached normally. image

windkh commented 5 hours ago

@reini12345 Hi, as it is raining today I found some time for fixing issues. I assume that the error is still there? How can I reproduce it? Any ideas?