AlexxIT / SonoffLAN

Control Sonoff Devices with eWeLink (original) firmware over LAN and/or Cloud from Home Assistant
https://github.com/AlexxIT/Blog
MIT License
2.74k stars 416 forks source link

Version 3 #751

Closed AlexxIT closed 2 years ago

AlexxIT commented 2 years ago

New version in new branch

Other

Check

AlexxIT commented 2 years ago

@mcv93us delete them

ajdiazv commented 2 years ago

Hi @AlexxIT Here the logs, and explanation of it. Step by step.

This is when integration start and read devices from the cloud. I just show this, 'cause are the involved devices. When temperature upper set (i have it in cold mode), activate the action device configured (10012a146b) on section [HMI_ATCDevice][id]

I start with ATCEnable: 0 (Disable), ATCMode:0 (Manual), ATCExpect0:16 (Expected Celsius Temp), tempCorrection:0 (0 degrees of correction on temp)

2022-04-25 10:42:36 DEBUG (MainThread) [custom_components.sonoff] 10012a146b == Init   | {'uiid': 6, 'extra': {'manufacturer': 'SONOFF', 'model': 'TX1C', 'sw_version': 'PSF-B01-GL v3.5.1'}, 'params': {'version': 8, 'only_device': {'ota': 'success'}, 'sledOnline': 'on', 'ssid': 'xxxxxxxx', 'bssid': '00:00:00:00:00:00', 'switch': 'off', 'fwVersion': '3.5.1', 'rssi': -54, 'staMac': '00:00:00:00:00:00', 'startup': 'off', 'init': 1, 'pulse': 'off', 'pulseWidth': 500, 'cloud': 'online'}}
2022-04-25 12:50:08 DEBUG (MainThread) [custom_components.sonoff] 100156c3c6 == Init   | {'uiid': 133, 'extra': {'manufacturer': 'SONOFF', 'model': 'NSPanel', 'sw_version': 'E32-MSW-NX v1.2.0'}, 'params': {'bindInfos': {'scene': 4}, 'version': 8, 'pulses': [{'pulse': 'off', 'width': 1000, 'outlet': 0}, {'pulse': 'off', 'width': 1000, 'outlet': 1}], 'switches': [{'switch': 'off', 'outlet': 0}, {'switch': 'off', 'outlet': 1}], 'configure': [{'startup': 'off', 'outlet': 0}, {'startup': 'off', 'outlet': 1}], 'lock': 0, 'fwVersion': '1.2.0', 'HMI_outdoorTemp': {'current': 18, 'range': '7,21'}, 'HMI_weather': 2, 'cityId': '60449', 'dst': 0, 'dstChange': '2022-09-04T04:00:00.000Z', 'geo': '0.00,0.00', 'timeZone': -4, 'temperature': 18, 'humidity': 50, 'tempUnit': 0, 'only_device': {'ota': 'success', 'ota_fail_reason': 0}, 'HMI_dimEnable': 1, 'HMI_dimOpen': 1, 'HMI_resources': [{'ctype': 'device', 'id': '10011d1821', 'uiid': 7}, {'ctype': 'device', 'id': '100126936b', 'uiid': 8}, {'ctype': 'device', 'id': '10012a146b', 'uiid': 6}, {'ctype': 'idle'}, {'ctype': 'idle'}, {'ctype': 'idle'}, {'ctype': 'idle'}, {'ctype': 'idle'}], 'HMI_ATCDevice': {'ctype': 'device', 'id': '10012a146b', 'outlet': 0, 'etype': 'cold', 'precision': 1}, 'ctype': 'device', 'id': '10012a146b', 'resourcetype': 'ATC', 'ATCEnable': 0, 'ATCMode': 0, 'ATCExpect0': 16, 'params': {'switch': 'on', 'switches': [{'switch': 'on', 'outlet': 1}]}, 'uiActive': 120, 'tempCorrection': 0, 'ATCExpect1': 16, 'cloud': 'online'}}

The first iteration: (sorry, I change the script to add some debug messages.. these that says AJDV)

2022-04-25 12:50:10 DEBUG (MainThread) [custom_components.sonoff.sonoff_cloud] Cloud init: {'error': 0, 'apikey': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', 'config': {'hb': 1, 'hbInterval': 145}, 'sequence': '1650905409977'}
2022-04-25 12:51:34 DEBUG (MainThread) [custom_components.sonoff.sonoff_cloud] 100156c3c6 <= Cloud3 | {'action': 'update', 'deviceid': '100156c3c6', 'apikey': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', 'userAgent': 'device', 'd_seq': 3959558, 'params': {'temperature': 18, 'humidity': 50, 'tempUnit': 0}, 'from': 'device', 'seq': '9'}
2022-04-25 12:51:34 DEBUG (MainThread) [custom_components.sonoff.sonoff_cloud] 100156c3c6 <= AJDV | UIID: 133
2022-04-25 12:51:34 DEBUG (MainThread) [custom_components.sonoff.sonoff_cloud] 100156c3c6 <= AJDV | Temp: 18.0

1.- Action: Change the TEMPERATURE UNIT from Celsius to Fahrenheit (tempUnit:1)

2022-04-25 12:54:01 DEBUG (MainThread) [custom_components.sonoff.sonoff_cloud] 100156c3c6 <= Cloud3 | {'action': 'update', 'deviceid': '100156c3c6', 'apikey': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', 'userAgent': 'app', 'sequence': '1650905619711', 'params': {'tempCorrection': 0, 'tempUnit': 1}, 'tempRec': '100156c3c6'}
2022-04-25 12:54:01 DEBUG (MainThread) [custom_components.sonoff.sonoff_cloud] 100156c3c6 <= AJDV | UIID: 133
2022-04-25 12:54:01 DEBUG (MainThread) [custom_components.sonoff.sonoff_cloud] 100156c3c6 <= AJDV | No available data

2.- Action: Change Temperature Calibration from 0 to 5.

2022-04-25 12:54:22 DEBUG (MainThread) [custom_components.sonoff.sonoff_cloud] 100156c3c6 <= Cloud3 | {'action': 'update', 'deviceid': '100156c3c6', 'apikey': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', 'userAgent': 'app', 'sequence': '1650905640664', 'params': {'tempCorrection': 5}, 'tempRec': '100156c3c6'}
2022-04-25 12:54:22 DEBUG (MainThread) [custom_components.sonoff.sonoff_cloud] 100156c3c6 <= AJDV | UIID: 133
2022-04-25 12:54:22 DEBUG (MainThread) [custom_components.sonoff.sonoff_cloud] 100156c3c6 <= AJDV | No available data
2022-04-25 12:54:26 DEBUG (MainThread) [custom_components.sonoff.sonoff_cloud] 100156c3c6 <= Cloud3 | {'action': 'update', 'deviceid': '100156c3c6', 'apikey': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', 'userAgent': 'device', 'd_seq': 4131435, 'params': {'temperature': 18, 'humidity': 50, 'tempUnit': 1}, 'from': 'device', 'seq': '9'}
2022-04-25 12:54:26 DEBUG (MainThread) [custom_components.sonoff.sonoff_cloud] 100156c3c6 <= AJDV | UIID: 133
2022-04-25 12:54:26 DEBUG (MainThread) [custom_components.sonoff.sonoff_cloud] 100156c3c6 <= AJDV | Temp: 18.0
2022-04-25 12:54:38 DEBUG (MainThread) [custom_components.sonoff.sonoff_cloud] 100156c3c6 <= Cloud3 | {'action': 'update', 'deviceid': '100156c3c6', 'apikey': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', 'userAgent': 'device', 'd_seq': 4143402, 'params': {'ATCMode': 0, 'ATCExpect0': 15.83333299}, 'from': 'device'}
2022-04-25 12:54:38 DEBUG (MainThread) [custom_components.sonoff.sonoff_cloud] 100156c3c6 <= AJDV | UIID: 133
2022-04-25 12:54:38 DEBUG (MainThread) [custom_components.sonoff.sonoff_cloud] 100156c3c6 <= AJDV | No available data

As you can see, tempCorrection to 5, temperature:18 (yes, is informed in celsius), tempUnit:1 (so far so good) ATCMode:0 (Manual), ATCExpect0: 15.83333299 (in Celsius)

3.- Action: Turn ON Thermostat

2022-04-25 12:54:38 DEBUG (MainThread) [custom_components.sonoff.sonoff_cloud] 100156c3c6 <= Cloud3 | {'action': 'update', 'deviceid': '100156c3c6', 'apikey': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', 'userAgent': 'app', 'sequence': '1650905656167', 'params': {'ATCEnable': 1}, 'tempRec': '100156c3c6'}
2022-04-25 12:54:38 DEBUG (MainThread) [custom_components.sonoff.sonoff_cloud] 100156c3c6 <= AJDV | UIID: 133
2022-04-25 12:54:38 DEBUG (MainThread) [custom_components.sonoff.sonoff_cloud] 100156c3c6 <= AJDV | No available data

AS you can see, ATCEnable to 1

4.- Change Desire Temp to 72° Fahren

2022-04-25 12:54:58 DEBUG (MainThread) [custom_components.sonoff.sonoff_cloud] 100156c3c6 <= Cloud3 | {'action': 'update', 'deviceid': '100156c3c6', 'apikey': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', 'userAgent': 'app', 'sequence': '1650905676768', 'params': {'ATCMode': 0, 'ATCExpect0': 22.22}, 'tempRec': '100156c3c6'}
2022-04-25 12:54:58 DEBUG (MainThread) [custom_components.sonoff.sonoff_cloud] 100156c3c6 <= AJDV | UIID: 133
2022-04-25 12:54:58 DEBUG (MainThread) [custom_components.sonoff.sonoff_cloud] 100156c3c6 <= AJDV | No available data

ATCMode:0 (Manual) ATCExpect0: 22.22 (informed in celsius)

5.- Change mode from MANUAL to AUTO

2022-04-25 12:55:36 DEBUG (MainThread) [custom_components.sonoff.sonoff_cloud] 100156c3c6 <= Cloud3 | {'action': 'update', 'deviceid': '100156c3c6', 'apikey': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', 'userAgent': 'app', 'sequence': '1650905714766', 'params': {'ATCMode': 1}, 'tempRec': '100156c3c6'}
2022-04-25 12:55:36 DEBUG (MainThread) [custom_components.sonoff.sonoff_cloud] 100156c3c6 <= AJDV | UIID: 133
2022-04-25 12:55:36 DEBUG (MainThread) [custom_components.sonoff.sonoff_cloud] 100156c3c6 <= AJDV | No available data

ATCMode:1 (Auto)

6.- Change Temp Settings on App: IT WILL HAVE TO BE TESTED IN MORE DETAIL, SINCE THIS SETTING WAS NOT INFORMED BY THE CLOUD.

7.- Change back to Manual:

2022-04-25 12:56:53 DEBUG (MainThread) [custom_components.sonoff.sonoff_cloud] 100156c3c6 <= Cloud3 | {'action': 'update', 'deviceid': '100156c3c6', 'apikey': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', 'userAgent': 'app', 'sequence': '1650905791318', 'params': {'ATCMode': 0}, 'tempRec': '100156c3c6'}
2022-04-25 12:56:53 DEBUG (MainThread) [custom_components.sonoff.sonoff_cloud] 100156c3c6 <= AJDV | UIID: 133
2022-04-25 12:56:53 DEBUG (MainThread) [custom_components.sonoff.sonoff_cloud] 100156c3c6 <= AJDV | No available data

ATCMode:0

8.- Change desire temp to 75° Fahren

2022-04-25 12:58:19 DEBUG (MainThread) [custom_components.sonoff.sonoff_cloud] 100156c3c6 <= Cloud3 | {'action': 'update', 'deviceid': '100156c3c6', 'apikey': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', 'userAgent': 'app', 'sequence': '1650905877252', 'params': {'ATCMode': 0, 'ATCExpect0': 23.89}, 'tempRec': '100156c3c6'}
2022-04-25 12:58:19 DEBUG (MainThread) [custom_components.sonoff.sonoff_cloud] 100156c3c6 <= AJDV | UIID: 133
2022-04-25 12:58:19 DEBUG (MainThread) [custom_components.sonoff.sonoff_cloud] 100156c3c6 <= AJDV | No available data

ATCExpect0: 23.89 in celsius

9.- Change desire temp to 76° Fahren (using the + sing)

2022-04-25 13:01:40 DEBUG (MainThread) [custom_components.sonoff.sonoff_cloud] 100156c3c6 <= Cloud3 | {'action': 'update', 'deviceid': '100156c3c6', 'apikey': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', 'userAgent': 'app', 'sequence': '1650906078290', 'params': {'ATCMode': 0, 'ATCExpect0': 24.44}, 'tempRec': '100156c3c6'}
2022-04-25 13:01:40 DEBUG (MainThread) [custom_components.sonoff.sonoff_cloud] 100156c3c6 <= AJDV | UIID: 133
2022-04-25 13:01:40 DEBUG (MainThread) [custom_components.sonoff.sonoff_cloud] 100156c3c6 <= AJDV | No available data

ATCExpect0: 24.44 in celsius

10.- Change from Fahren to Celsius

2022-04-25 13:04:10 DEBUG (MainThread) [custom_components.sonoff.sonoff_cloud] 100156c3c6 <= Cloud3 | {'action': 'update', 'deviceid': '100156c3c6', 'apikey': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', 'userAgent': 'app', 'sequence': '1650906227962', 'params': {'tempCorrection': 0, 'tempUnit': 0}, 'tempRec': '100156c3c6'}
2022-04-25 13:04:10 DEBUG (MainThread) [custom_components.sonoff.sonoff_cloud] 100156c3c6 <= AJDV | UIID: 133
2022-04-25 13:04:10 DEBUG (MainThread) [custom_components.sonoff.sonoff_cloud] 100156c3c6 <= AJDV | No available data

tempUnit:0 (celsius)

11.- Change correction Temperature to 1

2022-04-25 13:04:24 DEBUG (MainThread) [custom_components.sonoff.sonoff_cloud] 100156c3c6 <= Cloud3 | {'action': 'update', 'deviceid': '100156c3c6', 'apikey': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', 'userAgent': 'app', 'sequence': '1650906242424', 'params': {'tempCorrection': 1}, 'tempRec': '100156c3c6'}
2022-04-25 13:04:24 DEBUG (MainThread) [custom_components.sonoff.sonoff_cloud] 100156c3c6 <= AJDV | UIID: 133
2022-04-25 13:04:24 DEBUG (MainThread) [custom_components.sonoff.sonoff_cloud] 100156c3c6 <= AJDV | No available data

tempCorrection:1

12.- Set desire temp to 16° celsius

2022-04-25 13:04:42 DEBUG (MainThread) [custom_components.sonoff.sonoff_cloud] 100156c3c6 <= Cloud3 | {'action': 'update', 'deviceid': '100156c3c6', 'apikey': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', 'userAgent': 'app', 'sequence': '1650906260752', 'params': {'ATCMode': 0, 'ATCExpect0': 16}, 'tempRec': '100156c3c6'}
2022-04-25 13:04:42 DEBUG (MainThread) [custom_components.sonoff.sonoff_cloud] 100156c3c6 <= AJDV | UIID: 133
2022-04-25 13:04:42 DEBUG (MainThread) [custom_components.sonoff.sonoff_cloud] 100156c3c6 <= AJDV | No available data

ATCExpect0:16 in celsius

13.- Turn OFF Thermostat

2022-04-25 13:04:54 DEBUG (MainThread) [custom_components.sonoff.sonoff_cloud] 100156c3c6 <= Cloud3 | {'action': 'update', 'deviceid': '100156c3c6', 'apikey': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', 'userAgent': 'app', 'sequence': '1650906272552', 'params': {'ATCEnable': 0}, 'tempRec': '100156c3c6'}
2022-04-25 13:04:54 DEBUG (MainThread) [custom_components.sonoff.sonoff_cloud] 100156c3c6 <= AJDV | UIID: 133
2022-04-25 13:04:54 DEBUG (MainThread) [custom_components.sonoff.sonoff_cloud] 100156c3c6 <= AJDV | No available data

ATCEnable: 0 (off)

In other hand, The cloud constantly reports the ambient temperature, whenever there is a change. Some messages from the cloud doesn't include the temperature value. Only when really change. And it is reported in this way.

For Fahren..

2022-04-25 13:04:04 DEBUG (MainThread) [custom_components.sonoff.sonoff_cloud] 100156c3c6 <= Cloud3 | {'action': 'update', 'deviceid': '100156c3c6', 'apikey': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', 'userAgent': 'device', 'd_seq': 4709217, 'params': {'temperature': 18, 'humidity': 50, 'tempUnit': 1}, 'from': 'device', 'seq': '9'}
2022-04-25 13:04:04 DEBUG (MainThread) [custom_components.sonoff.sonoff_cloud] 100156c3c6 <= AJDV | UIID: 133
2022-04-25 13:04:04 DEBUG (MainThread) [custom_components.sonoff.sonoff_cloud] 100156c3c6 <= AJDV | Temp: 18.0

The temperature is reported or informed in celsius degrees, but tempUnit said it need to be converted to Fahren

For Celsius...

2022-04-25 13:04:14 DEBUG (MainThread) [custom_components.sonoff.sonoff_cloud] 100156c3c6 <= Cloud3 | {'action': 'update', 'deviceid': '100156c3c6', 'apikey': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', 'userAgent': 'device', 'd_seq': 4719436, 'params': {'temperature': 18, 'humidity': 50, 'tempUnit': 0}, 'from': 'device', 'seq': '9'}
2022-04-25 13:04:14 DEBUG (MainThread) [custom_components.sonoff.sonoff_cloud] 100156c3c6 <= AJDV | UIID: 133
2022-04-25 13:04:14 DEBUG (MainThread) [custom_components.sonoff.sonoff_cloud] 100156c3c6 <= AJDV | Temp: 18.0

Same, temperature reported in celsisus, but tempUnit said 0, so no convertion needed.

And off course, the constantly report the status of the "action device" involved in the thermostat. Remember: Humidity is always reported, but NSPANEL doesn't have one on it.

I f you want, i can send you the log to your email.

----------- *** -----------

@ajdiazv can you show payload when tempUnit=1? Also can you play with thermostat settings (on/off, mode, temp) and show integration debug logs?

PS. Thanks for other info. It's helpful.

ajdiazv commented 2 years ago

@AlexxIT An important thing about NSPanel.

When the "action device" is in ON state, 'cause the thermostat set to activate, and you turn OFF the thermostat the "action device" is no reset or setting to an OFF state automatically.

schreyack commented 2 years ago

Happy to report that my TH10 & TH16 sensors are working well on v3!!

cedsp commented 2 years ago

I have around 80 sonoff devices. when I upgrade to version 3. many stop working with HA. I have already unshared and re-shared the devices on ewelink, when I do that, others work again and another stop. going back to version 2.4.7 everything works fine. i am use ha with supervised

Masterz69 commented 2 years ago

So far - S26R1, S26R2, DualR3, 4CHPROR3 & RFBridge433 works fine with v3.

RF bridge transmit signals on PRESS. Previously created automation on sonoff.remote event also working.

Masterz69 commented 2 years ago

Reg. TH16R2. Can see current thermostat settings, like here - min/max/status: image

Changing thermostat settings in HA does NOT change actual settings on device and in ewelink - so far. Changing settings in ewelink immediately synced to HA - that's good.

Operation change between Heat & Off - works in both directions: HA -> ewelink & ewelink -> HA.

AlexxIT commented 2 years ago

Changing thermostat settings in HA does NOT change actual settings on device and in ewelink - so far.

Have you tried to reopen TH settings window in ewelink app? It loads data only on open moment.

Masterz69 commented 2 years ago

Have you tried to reopen TH settings window in ewelink app? It loads data only on open moment.

Device obey new settings, see screenshot. Lower threshold changed to 12C, actual is 11.3C -> heating activated. Fine. image

Defined in ewelink thermostat settings remain the same. Reopening TH setting page or application at all does not change them.

Probably ewelink not reading thermostat settings from device at all. They do not need that functionality IMHO. Only pushing from app to device.

!!! Just checked. Device works as thermostat if it activated from HA only. Had deleted Auto mode settings in ewelink. TH16 works based on HA parameters, with no Auto mode settings in ewelink.

grixtil commented 2 years ago

I have two issues:

didn’t have these issues with v2.


2022-04-26 13:19:14 [D] 1000fd0e41 !! skip setup for encrypted device
2022-04-26 13:19:14 [D] 100020d9b0 !! skip setup for encrypted device
2022-04-26 13:19:43 [D] 10002599e8 !! skip setup for encrypted device
2022-04-26 13:19:44 [D] 1000211728 !! skip setup for encrypted device
2022-04-26 13:28:35 [D] 30 devices loaded from Cloud
2022-04-26 13:28:35 [D] CLOUD mode start
2022-04-26 13:28:36 [D] Connected to cloud
2022-04-26 13:28:38 [D] 30 devices loaded from Cloud ```
AlexxIT commented 2 years ago

@grixtil have you split devices into Homes in ewelink app?

grixtil commented 2 years ago

@grixtil do you split devices into Homes in ewelink app?

No. They’re one house, logging in with main account credentials. They’re split into rooms but it’s picking randomly not by room.

AlexxIT commented 2 years ago

Well. My bad https://coolkit-technologies.github.io/eWeLink-API/#/en/APICenterV2?id=get-thing-list

The number of things to get. The default value, 30 will be used if not offered. 0 means to get all things.

grixtil commented 2 years ago

Well. My bad https://coolkit-technologies.github.io/eWeLink-API/#/en/APICenterV2?id=get-thing-list

The number of things to get. The default value, 30 will be used if not offered. 0 means to get all things.

You beat me to it, was going to quote you that part of the documentation :)

AlexxIT commented 2 years ago

@grixtil 30 devices limit fixed in latest master

Also fixed component work if user has groups!

Btw. Integration loads devices list only for "active" Home. If you using multiple Homes in ewelink app - it could be a problem.

Masterz69 commented 2 years ago

Just noticed issues with local status. Two devices (S26R1 & TH16R2) disconnected, but still "online" in HA. They become unavailable as soon I activated debug...

Actually disconnected ~3 hours ago, but history: image

After devices powered - become online. And still "online" .... despite log entries:

2022-04-26 20:31:39 [D] 1000f3e195 <= Cloud3 | {'online': False} | None
2022-04-26 20:31:42 [D] 1000cf7638 <= Cloud3 | {'online': False} | None

Time is 20:35, devices/entities still appears online. image

Debug log attached: sonofflan_20220426_01.txt

HA Core 2022.4.6, SonoffLAN 3.0rc3

Masterz69 commented 2 years ago

Continue to previous post.

While sending command to unpowered device (on 20:20 Debug activated):

2022-04-26 20:28:59 [D] 1000f3e195 <= Cloud3 | {'online': True} | None
2022-04-26 20:28:59 [D] 1000f3e195 <= Cloud3 | {'sledOnline': 'on', 'ssid': 'FANCY', 'bssid': 'f8:32:e4:92:73:28'} | None
...
2022-04-26 20:28:59 [D] 1000f3e195 <= Cloud3 | {'switch': 'off', 'fwVersion': '3.5.1', 'rssi': -83, 'staMac': 'A4:CF:12:DB:BA:3E', 'startup': 'off', 'init': 1, 'pulse': 'off', 'pulseWidth': 500} | None
...
2022-04-26 20:31:39 [D] 1000f3e195 <= Cloud3 | {'online': False} | None
...
2022-04-26 20:51:38 [D] 1000f3e195 => Local4 | {'switch': 'on'} !! Timeout 5
2022-04-26 20:51:38 [D] 1000f3e195 => Local4 | Check offline with timeout 20s
2022-04-26 20:51:44 [D] 1000f3e195 => Local4 | {'sledonline': 'on'}|  File "/config/custom_components/sonoff/core/ewelink/local.py", line 210, in send|    r = await self.session.post(|aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host 192.168.1.173:8081 ssl:default [Connect call failed ('192.168.1.173', 8081)]|
2022-04-26 20:51:58 [D] 1000f3e195 => Local4 | Check offline with timeout 40s
2022-04-26 20:52:01 [D] 1000f3e195 => Local4 | {'sledonline': 'on'}|  File "/config/custom_components/sonoff/core/ewelink/local.py", line 210, in send|    r = await self.session.post(|aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host 192.168.1.173:8081 ssl:default [Connect call failed ('192.168.1.173', 8081)]|
2022-04-26 20:52:38 [D] 1000f3e195 => Local4 | Check offline with timeout 60s
2022-04-26 20:52:41 [D] 1000f3e195 => Local4 | {'sledonline': 'on'}|  File "/config/custom_components/sonoff/core/ewelink/local.py", line 210, in send|    r = await self.session.post(|aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host 192.168.1.173:8081 ssl:default [Connect call failed ('192.168.1.173', 8081)]|
2022-04-26 20:52:41 [D] 1000f3e195 => Local4 | Device offline

Device/entities still "online": image

HA Core 2022.4.6, SonoffLAN 3.0rc3

AlexxIT commented 2 years ago

@ajdiazv thanks! Thermostat for NS Panel added to latest master

Masterz69 commented 2 years ago

Again about local offline issue. HA Core 2022.4.7, SonoffLAN 3.0rc4.

Devices 1000f3e195 & 1000cf7638 powered on on 12:18 & then disconnected from power on 12:30.

offline->online transition reflected in HA very fast. online->offline - never...

Till 12:45 they appear in HA as online.

sonofflan_20220427_01.txt

image

image

Masterz69 commented 2 years ago

See no more Check offline nor _LOGGER.debug(f"{deviceid} <= Local2 | Zeroconf Removed Event") log records. Looks like

    async def check_offline(self, device: XDevice):
        """Try to get response from device after received Zeroconf Removed."""

not firing anymore.

Question is: can Keenetic integration interfere ??? As it creates device_tracker. entities and follow devices status - btw it working fine as far I see.

Just found in log (from previous run ? home-assistant.log.1):

2022-04-26 20:52:41 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/config/custom_components/sonoff/core/ewelink/local.py", line 175, in check_offline
    self.dispatcher_send(SIGNAL_UPDATE, {"online": False})
  File "/config/custom_components/sonoff/core/ewelink/base.py", line 25, in dispatcher_send
    handler(*args, **kwargs)
  File "/config/custom_components/sonoff/core/ewelink/__init__.py", line 137, in local_update
    did: str = msg["deviceid"]
KeyError: 'deviceid'
AlexxIT commented 2 years ago

@Masterz69 maybe problem in new async zeroconf logic. I haven't tested it yet to see if it works well.

Masterz69 commented 2 years ago

@Masterz69 maybe problem in new async zeroconf logic. I haven't tested it yet to see if it works well.

I've added this later (by editing comment), did You see it:

2022-04-26 20:52:41 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/config/custom_components/sonoff/core/ewelink/local.py", line 175, in check_offline
    self.dispatcher_send(SIGNAL_UPDATE, {"online": False})
  File "/config/custom_components/sonoff/core/ewelink/base.py", line 25, in dispatcher_send
    handler(*args, **kwargs)
  File "/config/custom_components/sonoff/core/ewelink/__init__.py", line 137, in local_update
    did: str = msg["deviceid"]
KeyError: 'deviceid'

looks per some syntax issues ?

AlexxIT commented 2 years ago

@Masterz69 yes, I have seen it. But there is no logs for understand what was in msg. And why deviceid wasn't there.

Masterz69 commented 2 years ago

Hope it can help. I've started HA with

logger:
  default: debug

Then powered (12:26:34) and unpowered (after ~minute) devices.

Here is a HA log filtered by grep -E '(zeroconf|ewelink|sonoff|7638|e195)' :ha_log_20220428_01.zip

See in log when devices 'appears in zeroconf', but do not see removing...

Let assume zeroconf not functioning properly from some time. Why device still online when cloud status become offline:

2022-04-28 12:29:16 DEBUG (MainThread) [custom_components.sonoff.core.ewelink] 1000f3e195 <= Cloud3 | {'online': False} | None
Masterz69 commented 2 years ago

@Masterz69 yes, I have seen it. But there is no logs for understand what was in msg. And why deviceid wasn't there.

Just guess. May be in array stored string value 'deviceid' instead of actual deviceid ?

Masterz69 commented 2 years ago

@Masterz69 maybe problem in new async zeroconf logic. I haven't tested it yet to see if it works well.

Form which HA version ? Cause SonoffLAN v2 had no issues with zeroconf up to HA Core 2022.4.6 version! On same HA Core 2022.4.6 SonoffLAN v3 do not 'see' local offline anymore. As far I remember.

Masterz69 commented 2 years ago

@Masterz69 maybe problem in new async zeroconf logic. I haven't tested it yet to see if it works well.

Just installed SonoffLAN v.2.4.7 over HA Core 2022.4.7 Supervisor 2022.4.0 HA OS 7.4. Works exactly the SAME as before - on previous HA Core versions.

Device adding to and removal from network reflects in SonoffLAN perfectly.

Debug log attached: sonofflan_20220428_v2.txt

As soon v3.0rc installed - device removal from network not processes by integration anymore.

P.S. Despite v2.7.4 have some troubles to process zeroconf messages, it follow local online/offline devices status. But v3 only transition to online.

2022-04-28 15:28:25  DEBUG    main          SysInfo: {'version': '2022.4.7', 'dev': False, 'hassio': True, 'virtualenv': False, 'python_version': '3.9.9', 'docker': True, 'arch': 'aarch64', 'os_name': 'Linux', 'os_version': '5.10.92-v8', 'user': 'root', 'supervisor': '2022.04.0', 'host_os': 'Home Assistant OS 7.4', 'docker_version': '20.10.9', 'chassis': 'embedded'}
...
2022-04-28 15:48:34  DEBUG    switch        Refresh device state 1000cf7638
2022-04-28 15:48:47  DEBUG    sonoff_local  Problem while processing zeroconf: _ewelink._tcp.local., eWeLink_1000f3e195._ewelink._tcp.local.
2022-04-28 15:48:50  DEBUG    sonoff_local  Problem while processing zeroconf: _ewelink._tcp.local., eWeLink_1000cf7638._ewelink._tcp.local.
2022-04-28 15:53:34  DEBUG    switch        Refresh device state 1000cf7638
2022-04-28 15:56:07  DEBUG    sonoff_local  Problem while processing zeroconf: _ewelink._tcp.local., eWeLink_1000f21e74._ewelink._tcp.local.
2022-04-28 15:56:10  DEBUG    sonoff_local  Problem while processing zeroconf: _ewelink._tcp.local., eWeLink_10010a526e._ewelink._tcp.local.
2022-04-28 15:56:13  DEBUG    sonoff_local  Problem while processing zeroconf: _ewelink._tcp.local., eWeLink_10010a4f46._ewelink._tcp.local.
2022-04-28 15:56:16  DEBUG    sonoff_local  Problem while processing zeroconf: _ewelink._tcp.local., eWeLink_10010a5056._ewelink._tcp.local.
ajdiazv commented 2 years ago

@ajdiazv thanks! Thermostat for NS Panel added to latest master

@AlexxIT that's means that NSPanel (2 Switch, 1 sensor (thermostat)) are now (v3, not yet released) available in HA? I ask, because I don't see the NSPanel device in the list of supported devices in v3.

AlexxIT commented 2 years ago

@ajdiazv just did not update the list of supported devices

Masterz69 commented 2 years ago

FYI checked master as on 2022.04.29. 21:33 EEST.

  1. Reg. local offline - see changes, looks it working now:
    2022-04-29 21:43:11 [D] CLOUD True => True
    2022-04-29 21:44:30 [D] 1000f3e195 <= Cloud3 | {'online': False} | None
    2022-04-29 21:44:30 [D] 1000cf7638 <= Cloud3 | {'online': False} | None
    2022-04-29 21:44:33 [D] 1000f3e195 => Local4 | {'sledonline': 'on'}|  File "/config/custom_components/sonoff/core/ewelink/local.py", line 176, in send|    r = await self.session.post(|aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host 192.168.1.173:8081 ssl:default [Connect call failed ('192.168.1.173', 8081)]|
    2022-04-29 21:44:33 [D] 1000f3e195 !! Local4 | Device offline
    2022-04-29 21:44:46 [D] 1000cf7638 => Local4 | {'sledonline': 'on'} !! Timeout 15
    2022-04-29 21:44:46 [D] 1000cf7638 !! Local4 | Device offline

    Will try how it works in no Internet available.

~~2. As far I see - 4CHPROR3 & DUALR3 not working in local mode anymore in v3. They never counted in Setting->Info, only mine S26 & TH16 are counted as local. Hope it will be fixed.~~

So far pls ignore 2. - looks like have found a cause. Will check soon and describe.

Masterz69 commented 2 years ago

oopsi, was happy to early...

Devices unpowered, become in HA unavailable... looks good. But. Devices still unpowered, and suddenly become available in HA. Magic. They are actually unpowered, offline in ewelink app....

Here debug log: sonofflan_20220429_01.txt

ajdiazv commented 2 years ago

Hi @AlexxIT

More info about NSPanel Climate. About Target Temperature when changed from MANUAL to AUTO.

When first load and devices are read it from cloud, we can see 2 attributes:

2022-04-29 21:12:49 DEBUG (MainThread) [custom_components.sonoff] 100xxxxxxx == Init   | {'uiid': 133, 'extra': {'manufacturer': 'SONOFF', 'model': 'NSPanel', 'sw_version': 'E32-MSW-NX v1.2.0'}, 'params': {'bindInfos': {'scene': 4}, 'version': 8, 'pulses': [{'pulse': 'off', 'width': 1000, 'outlet': 0}, {'pulse': 'off', 'width': 1000, 'outlet': 1}], 'switches': [{'switch': 'off', 'outlet': 0}, {'switch': 'off', 'outlet': 1}], 'configure': [{'startup': 'off', 'outlet': 0}, {'startup': 'off', 'outlet': 1}], 'lock': 0, 'fwVersion': '1.2.0', 'HMI_outdoorTemp': {'current': 16, 'range': '5,24'}, 'HMI_weather': 33, 'cityId': '60449', 'dst': 0, 'dstChange': '2022-09-04T04:00:00.000Z', 'geo': '-33.000,-70.000', 'timeZone': -4, 'temperature': 16, 'humidity': 50, 'tempUnit': 0, 'only_device': {'ota': 'success', 'ota_fail_reason': 0}, 'HMI_dimEnable': 1, 'HMI_dimOpen': 1, 'HMI_resources': [{'ctype': 'device', 'id': '10011d1821', 'uiid': 7}, {'ctype': 'device', 'id': '100126936b', 'uiid': 8}, {'ctype': 'device', 'id': '10012xxxxx', 'uiid': 6}, {'ctype': 'idle'}, {'ctype': 'idle'}, {'ctype': 'idle'}, {'ctype': 'idle'}, {'ctype': 'idle'}], 'HMI_ATCDevice': {'ctype': 'device', 'id': '10012xxxxx', 'outlet': 0, 'etype': 'cold', 'precision': 1}, 'ctype': 'device', 'id': '10012xxxxx', 'resourcetype': 'ATC', 'ATCEnable': 0, 'ATCMode': 1, 'ATCExpect0': 16, 'params': {'switch': 'on', 'switches': [{'switch': 'on', 'outlet': 1}]}, 'uiActive': 120, 'tempCorrection': 1, 'ATCExpect1': 20, 'cloud': 'online'}}

ATCExpect0: 16 --- This is the LAST Target Temperature Setting on MANUAL mode. (Saved by the cloud before turn off HVCA) ATCExpect1: 20 --- This is the LAST Target Temperature Setting on AUTO mode. (Saved byt the cloud before turn off HVCA) ATCMode: 1 --- As we know id the HVCA Mode (0:Manual, 1:Auto), also saved by cloud before turn off HVCA, and was the last mode used before turn off.

When HVCA is turned on (and last state was AUTO), we have the following message from cloud;

2022-04-29 21:20:06 DEBUG (MainThread) [custom_components.sonoff.sonoff_cloud] 100xxxxxxx <= Cloud3 | {'action': 'update', 'deviceid': '100xxxxxxx ', 'apikey': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', 'userAgent': 'app', 'sequence': '1651281601118', 'params': {'ATCEnable': 1}, 'tempRec': '100xxxxxxx '}
2022-04-29 21:20:06 DEBUG (MainThread) [custom_components.sonoff.sonoff_cloud] 100xxxxxxx<= AJDV | UIID: 133
2022-04-29 21:20:06 DEBUG (MainThread) [custom_components.sonoff.sonoff_cloud] 100xxxxxxx<= AJDV | No available data

2022-04-29 21:20:06 DEBUG (MainThread) [custom_components.sonoff.sonoff_cloud] 100xxxxxxx<= Cloud3 | {'action': 'update', 'deviceid': '100xxxxxxx ', 'apikey': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', 'userAgent': 'device', 'd_seq': 173932995, 'params': {'ATCMode': 1}, 'from': 'device'}
2022-04-29 21:20:06 DEBUG (MainThread) [custom_components.sonoff.sonoff_cloud] 100xxxxxxx<= AJDV | UIID: 133
2022-04-29 21:20:06 DEBUG (MainThread) [custom_components.sonoff.sonoff_cloud] 100xxxxxxx<= AJDV | No available data

First Message inform about new state ATCEnable: 1 (turn on HVCA) Second Message inform that the Mode of HVCA is 1 (ATCMode:1), a.k.a AUTO Mode (as we know it was the last modeof HVCA before turn it off. (this was informed when reading the device initially from cloud, also the tempCorrection that is NOT informed again... unless the user changed in app)

This new message inform about the new target temperature in AUTO Mode (ATCMode:1) always is informed in ATCExpect1 attribute. This could be changed by the user in app or by calendar setting for HVCA in app for this device. Please note, that tempCorrection is not informed if it wasn't change from the last saved state.

2022-04-29 21:23:01 DEBUG (MainThread) [custom_components.sonoff.sonoff_cloud] 100xxxxxxx <= Cloud3 | {'action': 'update', 'deviceid': '100xxxxxxx', 'apikey': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', 'userAgent': 'server', 'sequence': '1651281776519', 'proxyMsgTime': 1651281776519, 'params': {'controlType': 9, 'ATCExpect1': 22, 'partnerApikey': 'ckserver-i-000276135eec53870-0000007'}, 'tempRec': '100xxxxxxx'}
2022-04-29 21:23:01 DEBUG (MainThread) [custom_components.sonoff.sonoff_cloud] 100xxxxxxx<= AJDV | UIID: 133
2022-04-29 21:23:01 DEBUG (MainThread) [custom_components.sonoff.sonoff_cloud] 100xxxxxxx<= AJDV | No available data

Here: controlType:9 --- I'm not sure what this means but always come when the temperature is setting by the AUTO mode when in calendar automatic function. ATCExpect1: 22 --- Target Temperature in AUTO mode always in celsius.

ATCExpect0: ---> IS the Target Temperature in Manual Mode. ATCExpect1: ---> IS the Targe Temperature in Auto Mode.

NOTE: 1.- When you switch from AUTO to MANUAL mode. The log is this one:

2022-04-29 21:36:27 DEBUG (MainThread) [custom_components.sonoff.sonoff_cloud] 100xxxxxxx <= Cloud3 | {'action': 'update', 'deviceid': '100156c3c6', 'apikey': 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', 'userAgent': 'app', 'sequence': '1651282582367', 'params': {'ATCMode': 0}, 'tempRec': '100156c3c6'}
2022-04-29 21:36:27 DEBUG (MainThread) [custom_components.sonoff.sonoff_cloud] 100xxxxxxx  <= AJDV | UIID: 133
2022-04-29 21:36:27 DEBUG (MainThread) [custom_components.sonoff.sonoff_cloud] 100xxxxxxx <= AJDV | No available data

ATCMode from 1 to 0 (Auto to Manual), note that tempCorrection is not informed and target temperature also is not informed, that because the setting is the same (or has not been change) from the last turn off of device.. (is informed once when device is readed from cloud)...

2.- When you turn on the Thermostat (HVCA) on app. A message arrives with new condition ATCEnable: 1 and a second message arrives with settings ATCMode:0 (or last used before off), and ATCExpect0: 17 (if manual mode, if ATCMode:1 (Auto) the target temperature is informed on ATCExpect1 attribute)

PLEASE NOTE THE FOLLOWING: ATCEnable:1 just means that the thermostat function is ON, NOT that the HMI_ATCDevice[id] (action device configured) is ON. You constantly while ATCEnable: 1 is activated, are receiving messages from cloud inform about the action device status... you can receive many many many of these messages telling you to switch off the action device configured... when NSpanel meet the conditions to activate the action device configured... then you will receive many many many (a lot ;) ) of messages from cloud telling you that switch ON the action device configured.

A lot, means about 1 message every 4 or 5 second. (185 messages in 15 minutes) and all says the same:

2022-04-29 21:34:10 DEBUG (MainThread) [custom_components.sonoff.sonoff_cloud] 10012xxxxx <= Cloud3 | {'action': 'update', 'deviceid': '10012xxxxx', 'apikey': 'xxxxxxxx-xxx-x-x-x-x-x-x', 'userAgent': 'app', 'sequence': '1651282445640', 'd_seq': 174777171, 'params': {'switch': 'off', 'switches': [{'switch': 'off', 'outlet': 0}]}, 'relationRec': '10015xxxxx', 'relationRecList': []}

the only change between messages are the 'sequence' and 'd_seq', the rest is always the same.

If you have any questions, or need to perform more tests, just let me know.

AlexxIT commented 2 years ago

@Masterz69 seems like zeroconf was broken near a year. Hope I fixed it in latest master version

@ajdiazv this logic already implemented except ATCExpect1. I don't know if it make sense to add it if user can't change it.

chinyaolin commented 2 years ago

Hi, I lose bssid sensor when upgrade to 3.0

sonoff: username: !secret my_sonoff_username password: !secret my_sonoff_password sensors: [bssid]

AlexxIT commented 2 years ago

@chinyaolin why anyone needs this sensor?

chinyaolin commented 2 years ago

@AlexxIT I use this sensor to determine whitch meshAP that my end device connect. bssid

Masterz69 commented 2 years ago

@Masterz69 seems like zeroconf was broken near a year. Hope I fixed it in latest master version

As far I have checked - in 3.0.0 it working properly. Thank You very much.

Can I suggest to check one minor stuff about 'Local device online' counters in Settings->Info ? Let me explain. On startup I have 7 local-capable devices, all online. I see 'Local device online 7/7' - fine. Then 2 more device become online, now 'Local device online 9/9' - also totally fine. Then after 2 devices unpowered - I expect to see 'Local device online 7/9', but appears '7/7' again.

IMHO second number could be count of locally-managed devices from whole list. Not locally online right now, but capable to be managed online.

AlexxIT commented 2 years ago

@Masterz69 the local counters may be different if you have devices with unknown devicekey. Example from different account.

chemelli74 commented 2 years ago

With both 3.0rc4 and 3.0.1, I often get the following error:

2022-05-01 18:33:26 WARNING (MainThread) [custom_components.sonoff] Can't login with mode: local
Traceback (most recent call last):
  File "/config/custom_components/sonoff/__init__.py", line 152, in async_setup_entry
    await registry.cloud.login(username, password)
  File "/config/custom_components/sonoff/core/ewelink/cloud.py", line 124, in login
    r = await self.session.post(
  File "/usr/local/lib/python3.9/site-packages/aiohttp/client.py", line 634, in _request
    break
  File "/usr/local/lib/python3.9/site-packages/aiohttp/helpers.py", line 721, in __exit__
    raise asyncio.TimeoutError from None
asyncio.exceptions.TimeoutError

Was not the case with previous rc.

Simone

chemelli74 commented 2 years ago

Sorry for the double posting, but I noticed that during shutdown there is another error coming from this component:

2022-05-01 18:32:18 ERROR (MainThread) [homeassistant] Error doing job: Exception in callback XRegistry.stop(<Event homeassistant_stop[L]>)
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/asyncio/events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
  File "/usr/src/homeassistant/homeassistant/core.py", line 967, in _onetime_listener
    self._hass.async_run_job(listener, event)
  File "/usr/src/homeassistant/homeassistant/core.py", line 571, in async_run_job
    return self.async_run_hass_job(HassJob(target), *args)
  File "/usr/src/homeassistant/homeassistant/core.py", line 531, in async_run_hass_job
    return self.async_add_hass_job(hassjob, *args)
  File "/usr/src/homeassistant/homeassistant/core.py", line 441, in async_add_hass_job
    cast(Callable[..., Awaitable[_R]], hassjob.target)(*args)
TypeError: stop() takes 1 positional argument but 2 were given

Simone

AlexxIT commented 2 years ago

@chemelli74 are you sure you get stop() error from latest version? Because it was fixed 4 days ago https://github.com/AlexxIT/SonoffLAN/commit/4de4309ab3819526b9f8b7033ebb8bcb20453aa5

cloud timeout because some problems with Internet connection

Ih8rain2 commented 2 years ago

Just for the record. My zigbee bridges disappeared but the connected devices not. Really strange. I will try to dig deeper later today.

ajdiazv commented 2 years ago

Hi @AlexxIT for NSPanel.... the temperature show in HA doesn't have the correction applied... HA show 15°, but NSPanel said 16°, because the tempCorrection attribute is 1°... The cloud always inform the temperature without the correction... it's have to be corrected.

cedsp commented 2 years ago

Integration with blinds is not working in the new version. manufacturer: kingart model: king-q4

2022-05-02 17:23:59 ERROR (MainThread) [custom_components.sonoff.core.entity] Can't init device: {'name': 'PERSIANA CASAL', 'deviceid': '1000ced7d6', 'apikey': 'bdb004b6-9e55-4d24-ac96-4c7818ac1c98', 'extra': {'uiid': 11, 'description': '20191120004', 'brandId': '59ba53ad86b3ab5e3ae68596', 'apmac': 'd0:27:01:9d:ac:fd', 'mac': 'd0:27:01:9d:ac:fc', 'ui': '电动窗帘', 'modelInfo': '5b83d2114a6b22f51544b4d5', 'model': 'PSF-BTA-GL', 'manufacturer': '深圳市彪王科技有限公司', 'chipid': '00BEB171', 'staMac': 'D8:F1:5B:BE:B1:71'}, 'brandName': 'KingArt', 'brandLogo': 'https://us-ota.coolkit.cc/logo/w9sMg5WxAWp0o9OBeqyH0rcOJKEVKaKi.png', 'showBrand': True, 'productModel': 'KING-Q4', 'devConfig': {}, 'settings': {'opsNotify': 0, 'opsHistory': 1, 'alarmNotify': 1, 'wxAlarmNotify': 0, 'wxOpsNotify': 0, 'wxDoorbellNotify': 0, 'appDoorbellNotify': 1}, 'devGroups': [], 'family': {'familyid': '60304283067a9d000708be9a', 'index': -165}, 'sharedBy': {'apikey': 'bdb004b6-9e55-4d24-ac96-4c7818ac1c98', 'email': 'carlos.e.pinto@l.com', 'nickname': 'cep', 'comment': '', 'permit': 15, 'shareTime': 1651522981897}, 'devicekey': '4a1ab67c-eada-4a1c-b349-4f4781f3bbc5', 'online': True, 'params': {'bindInfos': {'alexa': ['bdb004b6-9e55-4d24-ac96-4c7818ac1c98_26ca1996a20e8bd63617ab272d4eeede1d2d8e32'], 'gaction': ['bdb004b6-9e55-4d24-ac96-4c7818ac1c98_ewelink-google-home-v1', 'bdb004b6-9e55-4d24-ac96-4c7818ac1c98_ewelinkGoogleHome']}, 'version': 8, 'sledOnline': 'on', 'ssid': 'cedsp_wifi', 'bssid': '6a:7d:6b:87:a3:9f', 'rssi': -56, 'fwVersion': '3.4.3', 'staMac': 'D8:F1:5B:BE:B1:71', 'switch': 'pause', 'setclose': 93, 'only_device': {'ota': 'success'}}, 'isSupportGroup': False, 'isSupportedOnMP': True, 'deviceFeature': {}} Traceback (most recent call last): File "/config/custom_components/sonoff/core/entity.py", line 82, in init self.internal_update(params) File "/config/custom_components/sonoff/core/entity.py", line 100, in internal_update self.set_state(params) File "/config/custom_components/sonoff/cover.py", line 44, in set_state self._attr_is_closing = pos < self._attr_current_cover_position TypeError: '<' not supported between instances of 'int' and 'NoneType'

AlexxIT commented 2 years ago

@cedsp #792

AlexxIT commented 2 years ago

@ajdiazv I have removed separate temp sensor for NSPanel because temp data already in Climate entity and it's shows with correction

ianfretwell commented 2 years ago

I seem to have some issue when I enabled the climate entity on my TH16R2 - half my other devices become unavailable - along with the actual temp and humidity sensors on the TH16R2 itself... Disabling the climate entity and restarting brings everything back OK.

Issue present in 3.0.0 and 3.02 - so presumably all other v3.x versions.

Logs below which don't appear to show an issue to me... (& which I might still not be posting correctly - apologies if so)

2022-05-03 08:33:14 [D] SysInfo: {'installation_type': 'Home Assistant Container', 'version': '2022.4.7', 'dev': False, 'hassio': False, 'virtualenv': False, 'python_version': '3.9.9', 'docker': True, 'arch': 'x86_64', 'timezone': 'Europe/London', 'os_name': 'Linux', 'os_version': '5.10.60-qnap', 'user': 'root', 'sonoff_version': '3.0.2'}
2022-05-03 08:33:18 [D] 10 devices loaded from Cloud
2022-05-03 08:33:19 [D] 10013ce8f9 UIID 0015 | {'version': 8, 'only_device': {'ota': 'success'}, 'sledOnline': 'on', 'init': 1, 'switch': 'off', 'fwVersion': '3.5.0', 'rssi': -44, 'startup': 'off', 'pulse': 'off', 'pulseWidth': 500, 'sensorType': 'AM2301', 'currentHumidity': '71', 'currentTemperature': '15.0', 'mainSwitch': '', 'deviceType': 'normal', 'switches': [{'switch': 'on', 'outlet': 0}]}
2022-05-03 08:33:19 [D] 10003adba3 UIID 0006 | {'rssi': -68, 'timers': [], 'startup': 'stay', 'fwVersion': '3.5.1', 'switch': 'on', 'sledOnline': 'on', 'init': 1, 'pulse': 'off', 'pulseWidth': 500, 'version': 8, 'only_device': {'ota': 'success'}}
2022-05-03 08:33:19 [D] 1000dfa3b2 UIID 0001 | {'version': 8, 'sledOnline': 'on', 'switch': 'off', 'fwVersion': '3.5.1', 'rssi': -73, 'startup': 'off', 'init': 1, 'pulse': 'off', 'pulseWidth': 500, 'only_device': {'ota': 'success'}, 'switches': [{'switch': 'off', 'outlet': 0}]}
2022-05-03 08:33:19 [D] 1000b36745 UIID 0036 | {'version': 8, 'sledOnline': 'on', 'rssi': -52, 'fwVersion': '3.4.3', 'switch': 'off', 'bright': 100, 'only_device': {'ota': 'success'}, 'timers': [{'mId': '3f96bd90-45c7-d49b-3a8b-2ac8b1c22a36', 'type': 'repeat', 'at': '30 0 * * 0,1,2,3,4,5,6', 'coolkit_timer_type': 'repeat', 'enabled': 1, 'do': {'switch': 'off'}}]}
2022-05-03 08:33:19 [D] 10003aeb64 UIID 0008 | {'rssi': -63, 'switches': [{'switch': 'on', 'outlet': 0}, {'switch': 'on', 'outlet': 1}, {'switch': 'on', 'outlet': 2}, {'switch': 'off', 'outlet': 3}], 'fwVersion': '3.5.1', 'configure': [{'startup': 'stay', 'outlet': 0}, {'startup': 'stay', 'outlet': 1}, {'startup': 'stay', 'outlet': 2}, {'startup': 'off', 'outlet': 3}], 'init': 1, 'pulse': 'off', 'pulseWidth': 0, 'timers': [], 'version': 8, 'sledOnline': 'on', 'lock': 0, 'pulses': [{'pulse': 'off', 'width': 1000, 'outlet': 0}, {'pulse': 'off', 'width': 1000, 'outlet': 1}, {'pulse': 'off', 'width': 1000, 'outlet': 2}, {'pulse': 'off', 'width': 1000, 'outlet': 3}], 'only_device': {'ota': 'success'}}
2022-05-03 08:33:19 [D] 10003ade61 UIID 0006 | {'rssi': -50, 'timers': [], 'startup': 'stay', 'fwVersion': '3.5.1', 'switch': 'on', 'sledOnline': 'on', 'init': 1, 'pulse': 'off', 'pulseWidth': 500, 'version': 8, 'only_device': {'ota': 'success'}}
2022-05-03 08:33:19 [D] 10003adb2f UIID 0006 | {'version': 8, 'sledOnline': 'on', 'switch': 'on', 'fwVersion': '3.5.1', 'rssi': -56, 'startup': 'stay', 'init': 1, 'pulse': 'off', 'pulseWidth': 500}
2022-05-03 08:33:19 [D] 10003ae154 UIID 0006 | {'rssi': -56, 'timers': [], 'startup': 'stay', 'fwVersion': '3.5.1', 'switch': 'on', 'sledOnline': 'on', 'init': 1, 'pulse': 'off', 'pulseWidth': 10000, 'version': 8, 'only_device': {'ota': 'success'}}
2022-05-03 08:33:19 [D] 100148a8d6 UIID 0133 | {'version': 8, 'pulses': [{'pulse': 'off', 'width': 1000, 'outlet': 0}, {'pulse': 'off', 'width': 1000, 'outlet': 1}], 'switches': [{'switch': 'on', 'outlet': 0}, {'switch': 'on', 'outlet': 1}], 'configure': [{'startup': 'stay', 'outlet': 0}, {'startup': 'stay', 'outlet': 1}], 'lock': 0, 'fwVersion': '1.2.0', 'temperature': 19, 'humidity': 50, 'tempUnit': 0, 'HMI_outdoorTemp': {'current': 8, 'range': '9,14'}, 'HMI_weather': 7, 'cityId': '326914', 'dst': 1, 'dstChange': '2022-10-30T01:00:00.000Z', 'geo': '53.3825,-1.47194', 'timeZone': 0, 'HMI_ATCDevice': {'ctype': 'device', 'id': '10013ce8f9', 'outlet': 0, 'etype': 'cold'}, 'ctype': 'device', 'id': '10013ce8f9', 'resourcetype': 'ATC', 'ATCEnable': 0, 'ATCMode': 0, 'ATCExpect0': 26, 'HMI_dimEnable': 1, 'HMI_resources': [{'ctype': 'device', 'id': '10003ae150', 'uiid': 6}, {'ctype': 'idle'}, {'ctype': 'device', 'id': '1000dfa3b2', 'uiid': 1}, {'ctype': 'scene', 'id': '61dd5af0b615852f758669d6'}, {'ctype': 'idle'}, {'ctype': 'idle'}, {'ctype': 'idle'}, {'ctype': 'scene', 'id': '61dd5b0ab615852f758669d8'}], 'ATCExpect1': -999, 'HMI_dimOpen': 0, 'only_device': {'ota': 'success', 'ota_fail_reason': 0}, 'tempCorrection': -2, 'cityStr': 'Sheffield'}
2022-05-03 08:33:19 [D] 10003ae150 UIID 0006 | {'rssi': -68, 'timers': [{'enabled': 1, 'coolkit_timer_type': 'repeat', 'at': '0 0 * * 1,2,3,4,5,6,0', 'type': 'repeat', 'do': {'switch': 'off'}, 'mId': 'bbc4dcad-6cc1-4406-cc40-68192054f48e'}], 'startup': 'stay', 'fwVersion': '3.5.1', 'switch': 'off', 'sledOnline': 'off', 'init': 1, 'pulse': 'off', 'pulseWidth': 500, 'version': 8, 'only_device': {'ota': 'success'}, 'switches': [{'switch': 'off', 'outlet': 0}]}
2022-05-03 08:33:19 [D] AUTO mode start
2022-05-03 08:33:20 [D] CLOUD False => True
2022-05-03 08:33:20 [D] 100148a8d6 <= Local3 | {'switches': [{'switch': 'on', 'outlet': 0}, {'switch': 'on', 'outlet': 1}], 'pulses': [{'pulse': 'off', 'width': 1000, 'outlet': 0}, {'pulse': 'off', 'width': 1000, 'outlet': 1}], 'configure': [{'startup': 'stay', 'outlet': 0}, {'startup': 'stay', 'outlet': 1}], 'lock': 0} | 2
2022-05-03 08:33:22 [D] 10003aeb64 <= Local3 | {'sledOnline': 'on', 'configure': [{'startup': 'stay', 'outlet': 0}, {'startup': 'stay', 'outlet': 1}, {'startup': 'stay', 'outlet': 2}, {'startup': 'off', 'outlet': 3}], 'pulses': [{'pulse': 'off', 'width': 1000, 'outlet': 0}, {'pulse': 'off', 'width': 1000, 'outlet': 1}, {'pulse': 'off', 'width': 1000, 'outlet': 2}, {'pulse': 'off', 'width': 1000, 'outlet': 3}], 'switches': [{'switch': 'on', 'outlet': 0}, {'switch': 'on', 'outlet': 1}, {'switch': 'on', 'outlet': 2}, {'switch': 'off', 'outlet': 3}]} | 30
2022-05-03 08:33:22 [D] 10003ade61 <= Local3 | {'switch': 'on', 'startup': 'stay', 'pulse': 'off', 'sledOnline': 'on', 'pulseWidth': 500, 'rssi': -50} | 98
Ih8rain2 commented 2 years ago

Just for the record. My zigbee bridges disappeared but the connected devices not. Really strange. I will try to dig deeper later today.

solved my issues!

Ih8rain2 commented 2 years ago

latest upgrade worked great however the wifi door sensor battery level (still) doesnt work as before!

chemelli74 commented 2 years ago

@chemelli74 are you sure you get stop() error from latest version? Because it was fixed 4 days ago 4de4309

cloud timeout because some problems with Internet connection

Yup, and now also on 3.0.2:

2022-05-03 17:53:22 WARNING (MainThread) [custom_components.sonoff] Can't login with mode: local
Traceback (most recent call last):
  File "/config/custom_components/sonoff/__init__.py", line 156, in async_setup_entry
    await registry.cloud.login(username, password)
  File "/config/custom_components/sonoff/core/ewelink/cloud.py", line 124, in login
    r = await self.session.post(
  File "/usr/local/lib/python3.9/site-packages/aiohttp/client.py", line 634, in _request
    break
  File "/usr/local/lib/python3.9/site-packages/aiohttp/helpers.py", line 721, in __exit__
    raise asyncio.TimeoutError from None
asyncio.exceptions.TimeoutError