StyraHem / ShellyForHASS

Shelly smart home platform for Home Assistant
MIT License
619 stars 112 forks source link

Release 0.1.7 beta1 bug: flip from unavailable to available #207

Closed catalinbordan closed 4 years ago

catalinbordan commented 4 years ago

Hello,

I have upgraded to 0.1.7 and I have a lot of error in logs and the sensors from shelly is fliping in loop from unavailable to available in a matters of some seconds. Here are some printscrn. if you need more details please let me know because I don't know what to send. image

image

Extras from logs: https://hassio/community_plugin/custom-header/custom-header.js:145:62319 Uncaught TypeError: Cannot read property 'dispatchEvent' of undefined 5:22 PM components/system_log/init.py (ERROR) - message first occurred at 4:56 PM and shows up 5 times [Living Google Home mini:8009] Heartbeat timeout, resetting connection 5:17 PM /usr/local/lib/python3.7/site-packages/pychromecast/socket_client.py (WARNING) Error doing job: Task exception was never retrieved 5:05 PM helpers/entity_platform.py (ERROR) - message first occurred at 5:04 PM and shows up 64 times Entity binary_sensor.shelly_shsw_25_10ec8c_2_switch is incorrectly being triggered for updates while it is disabled. This is a bug in the shelly integration. 5:05 PM helpers/entity.py (WARNING) Entity binary_sensor.shelly_shsw_25_10ec8c_1_switch is incorrectly being triggered for updates while it is disabled. This is a bug in the shelly integration. 5:05 PM helpers/entity.py (WARNING) Error doing job: Task exception was never retrieved 5:05 PM custom_components/shelly/block.py (ERROR) Entity binary_sensor.shelly_shsw_pm_00e722_switch is incorrectly being triggered for updates while it is disabled. This is a bug in the shelly integration. 5:04 PM helpers/entity.py (WARNING) Entity binary_sensor.shelly_shsw_25_f37ad7_2_switch is incorrectly being triggered for updates while it is disabled. This is a bug in the shelly integration. 5:04 PM helpers/entity.py (WARNING) Entity binary_sensor.shelly_shsw_25_f37ad7_1_switch is incorrectly being triggered for updates while it is disabled. This is a bug in the shelly integration. 5:04 PM helpers/entity.py (WARNING) Entity binary_sensor.shelly_shsw_pm_e67b81_switch is incorrectly being triggered for updates while it is disabled. This is a bug in the shelly integration. 5:04 PM helpers/entity.py (WARNING) Entity binary_sensor.shelly_shsw_pm_e67b43_switch is incorrectly being triggered for updates while it is disabled. This is a bug in the shelly integration. 5:04 PM helpers/entity.py (WARNING) Entity binary_sensor.shelly_shsw_pm_e5fc38_switch is incorrectly being triggered for updates while it is disabled. This is a bug in the shelly integration. 5:04 PM helpers/entity.py (WARNING) Error setting up entry configuration.yaml for sensor 5:04 PM helpers/entity_component.py (ERROR) Error setting up entry configuration.yaml for switch 5:04 PM helpers/entity_component.py (ERROR) Error doing job: Task exception was never retrieved 5:03 PM custom_components/shelly/init.py (ERROR) - message first occurred at 4:56 PM and shows up 103 times Error update device status: 10EE7B-2 SHSW-25, 'power', Traceback (most recent call last): File "/usr/local/lib/python3.7/site-packages/pyShelly/block.py", line 119, in update_status_information dev.update_status_information(status) File "/usr/local/lib/python3.7/site-packages/pyShelly/relay.py", line 77, in update_status_information self._update(new_state, info_values=self.info_values) File "/usr/local/lib/python3.7/site-packages/pyShelly/device.py", line 102, in _update self.raise_updated() File "/usr/local/lib/python3.7/site-packages/pyShelly/device.py", line 112, in raise_updated callback(self) File "/config/custom_components/shelly/device.py", line 58, in _updated if ALL_SENSORS[sensor].get('attr') == key: KeyError: 'power' 4:58 PM custom_components/shelly/device.py (ERROR) Error update device status: 1101A9-2 SHSW-25, 'power', Traceback (most recent call last): File "/usr/local/lib/python3.7/site-packages/pyShelly/block.py", line 119, in update_status_information dev.update_status_information(status) File "/usr/local/lib/python3.7/site-packages/pyShelly/relay.py", line 77, in update_status_information self._update(new_state, info_values=self.info_values) File "/usr/local/lib/python3.7/site-packages/pyShelly/device.py", line 102, in _update self.raise_updated() File "/usr/local/lib/python3.7/site-packages/pyShelly/device.py", line 112, in raise_updated callback(self) File "/config/custom_components/shelly/device.py", line 58, in _updated if ALL_SENSORS[sensor].get('attr') == key: KeyError: 'power' 4:57 PM custom_components/shelly/device.py (ERROR) - message first occurred at 4:56 PM and shows up 2 times

chemelli74 commented 4 years ago

I have a issue with an automation that monitor "cloud connected" state: flip from connect to disconnected every few seconds.

Simone

thehijacker commented 4 years ago

Same issue I had is again not connected to HA or ShellyforHass addon. Its the damned hairpin NAT rule on my Mikrotik router. I redone it once again and disable the rule for UDP traffic (CoAP):

chain=srcnat action=masquerade protocol=!udp src-address=192.168.64.0/24 dst-address=192.168.64.0/24 log=no log-prefix=""

Issues was with calling URL http://192.168.64.40/settings . It used just for this URL my gateway IP http://192.168.64.1/settings which of course failed.

Having my mesh WiFi network (3 nodes) connected and device managed by Mikrotik router I can finally see what is going on.

If it helps for someone.

chemelli74 commented 4 years ago

@catalinbordan , please update to b2 and confirm fixed. Here everything works fine with latest beta.

Simone

catalinbordan commented 4 years ago

Hello, Unfortunately for me it is worst then before. Last night I installed beta3(also beta2), and all devices are offline(also sensors). In integration page where I have figured out that I have to make the first(migration) setup, the button is show me a small page in infinite(loop) loading. Also I can see in the logs that are some problems with the addon shelly in hacs(maybe because I can not make the setup from integration). browser chrome, 4k resolution and last HA 0.107. I also tried without configuration in yaml(with restart).

chemelli74 commented 4 years ago

Please post the log.

Simone

catalinbordan commented 4 years ago

Hi, The error is the same like the user on Facebook group: Kevin Sudlow. Maybe it is related to last version of HA 0.107 https://www.facebook.com/groups/shellyforhass/permalink/538271890135699/?sfnsn=mo

chemelli74 commented 4 years ago

@catalinbordan, @thehijacker , if you can please test with HA 0.106.6 and pugin 0.1.7b3.

If confirmed to be working, we close this issue and open a new one for incompatibility between latest builds and HA 0.107.

Thank you for your help,

Simone

catalinbordan commented 4 years ago

@chemelli74 Sorry, but I can not rollback to 0.106. no backup. Plus it is the live system for heating of the house. For you it is working? let's try to find the difference in the system. Thanks,

chemelli74 commented 4 years ago

@chemelli74 Sorry, but I can not rollback to 0.106. no backup. Plus it is the live system for heating of the house. For you it is working? let's try to find the difference in the system. Thanks,

HA 0.10.6.6 and plugin 0.1.7b3 works like a charm here. I'm preparing my test environment, using docker. Will test as well the upgrade during WE.

But I'm under the impression that there is a issue in your own environment.

Do you have the ability to prepare a test system ? Will help not only for that issue but for the future as well.

Simone

P.S. Renamed #226; if this will be closed, we will continue in that issue.

chemelli74 commented 4 years ago

After intensive tests on two different envionments ( 0.106.6 and 0.107.1) both with 0.1.7b3, I can say that the first is working as expected, reliable and fast.

I close this issue as the topic issue is now solved.

Discussion about 0.107.x continues on #226

Simone