Giter Club home page Giter Club logo

sonoff-lan-mode-homeassistant's Introduction

Latest PyPi Release Updates Python 3 Buy Me A Coffee

No longer maintained!

This component is no longer being maintained, instead use https://github.com/AlexxIT/SonoffLAN, which is more functional and stable. Any future contributions I make will be to this repo.

sonoff-lan-mode-homeassistant

Home Assistant platform to control Sonoff switches running the V3+ Itead firmware (tested on 3.0, 3.0.1, 3.1.0, 3.3.0, 3.4.0, 3.5.0), locally (LAN mode).

This will only work for Sonoff devices running V3+ of the stock (Itead / eWeLink) firmware. For users of V1.8.0 - V2.6.1, please see the code in this repository https://github.com/beveradb/sonoff-lan-mode-homeassistant

This is a simple platform to control switch devices which can normally only be controlled using the Itead cloud app (eWeLink). It may be useful to you if you've bought a Sonoff device and want to control it locally, but cannot flash firmware such as Tasmota for whatever reason (e.g. its already in the wall, lack of tools or confidence soldering or you don't want to forgoe using eWeLink also).

Tested Devices

  • Sonoff Basic R2
  • Sonoff Basic R3 (both DIY and eWebLink modes)
  • Sonoff RF
  • Sonoff RF R3 (both DIY and eWebLink modes)
  • Sonoff S20
  • Sonoff S26
  • Sonoff T1 UK 1 Gang
  • Sonoff R2 POW
  • Sonoff S31
  • Sonoff 4CH Pro
  • Sonoff iFan02
  • Sonoff TH16
  • Sonoff SV
  • Hoch/WDYK ZJSB9-80 Wifi

Expected Supported devices:

  • Sonoff Mini
  • Sonoff S85
  • Sonoff T1 US/EU 1 Gang
  • Sonoff S30
  • Sonoff S31 Lite
  • Sonoff Slampher
  • Sonoff Touch EU/US

Unsupported Devices

  • Sonoff iFan03
  • Any that can't run V3+ firmware

However, I am very confident that if your device works with the eWeLink app in LAN Mode, we can get it working with this component - we might need a bit of joint investigation (e.g. tcpdump of communication from app) first to get it working!

What is LAN Mode?

Since mid 2018, the firmware Itead have shipped with Sonoff devices has provided a feature called "LAN Mode" which allows the device to be controlled directly on the local network using a WebSocket or HTTP REST connection on port 8081.

Whilst older devices only dropped into LAN mode when the internet was unavailable, the latest V3 firmware are designed to be used in LAN mode predominantly. Note: the eWeLink app doesn't show this very well and when you turn it to LAN mode, it doesn't report that it has connected to V3 devices in this mode. Many users are therefore unaware of this and believe the device to be connected via internet, however there is an icon against the device showing a LAN icon when using LAN mode.

Here's a video demonstration of a Sonoff Basic being controlled in LAN mode: https://www.youtube.com/watch?v=sxtt2cNm8g8

Setup

Before you can use this platform to control your Sonoff from Home Assistant, you should perform the following setup steps:

  1. Find the "Device ID" of you switch in the eWeLink app, it is under the device settings.
  2. For non DIY devices, you need to find the api key (which is used for encryption). DIY branded devices, when configured using the jumper switch do not need the api key configured as they run without encryption.

See https://pysonofflanr3.readthedocs.io/encryption.html

Installation

To use this platform, copy the folder 'custom_components/sonoff_lan_mode_r3' into your "/custom_components/ directory and add the config below to configuration.yaml

You will also need to be on Home Assistant v94.0 or newer (to pick up the more recent zeroconf dependency).

switch:
  - platform: sonoff_lan_mode_r3
    name: // Switch Name
    device_id: // device id (e.g. obtained from eWeLink app)
    api_key: // [Required unless in DIY mode] api_key obtained during pairing or from V2 firmware trace
    icon: // [Optional] Custom icon for device
    outlet: // [Optional] Outlet number, numbered form 0 to 3 on a 4CH as opposed to 1-4 as in the eWeLink interface

Example:

switch:
  - platform: sonoff_lan_mode_r3
    name: Kitchen
    device_id: 1000111111
    api_key: 12345678-90AB-CDEF-1234-567890ABCDEF # not needed for devices in DIY mode
    icon: mdi:lightbulb
    outlet: 0

Debugging

If raising issues with this component, please consider capturing the appropriate part of the HA log when debug is enabled as below in configuration.yaml

logger:
  default: warn
  logs:
    custom_components.sonoff_lan_mode_r3: debug

Future

It would be easier for users if the api key was reported by the eWeLink app. Here is a feature request I've raised with Itead https://support.itead.cc/support/discussions/topics/11000026824

At the moment, there is no discovery, but that would be fairly easy to implement.

See Also

There is a thread on the Home Assistant Community here discussing this component https://community.home-assistant.io/t/new-custom-component-sonoff-lan-mode-local-with-stock-firmware/88132/66

[ ~ Dependencies scanned by PyUp.io ~ ]

sonoff-lan-mode-homeassistant's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

sonoff-lan-mode-homeassistant's Issues

Sonoff Basic R3 DIY mode with 3.3.0 firmware

error log.txt

I finally received a Sonoff Basic R3 and succeeded in getting it into DIY mode and establish a connection to the DIY demo app. A bit complicated.
Tried to put it into Home Assistant using your component. The switch was created but I cannot activate on or off. But when I turn the Sonoff Basic R3 on in the demo program or manually by pressing the switch, the status of the switch in HA changes status. But in HA the switch doesn’t work.
Sonoff firmware version 3.30
switch.yaml:

  • platform: sonoff_lan_mode_r3
    name: test
    device_id: 100086f13b

Allow client timeout to be configurable

I was getting an Update message not received in timeout period, retry message every minute after first using a switch, I imagine because I use Home Assistant on an old RPI with a less than ideal network setup. When these messages started firing up, the switch became very unresponsive.

I changed the local code to create the Switch class with a 20 second timeout and the problem seems to be gone so might be a good idea allow it to be configurable. Also, I'm not sure if the issue I was seeing was actually a bug in the way those requests are retried.

Also, huge thanks for this component, works like a charm!

Multi outlet devices

Multi outlets devices

However, I am very confident that if your device works with the eWeLink app in LAN Mode, we can get it working with this component - we might need a bit of joint investigation (e.g. tcpdump of communication from app) first to get it working!

Hi. Refer to the above. I have a sonoff 3 gang switch and a ifan03. What information do you need to get it working.

4CH Pro Unavailable channels (but not all) in Home Assistant

HA Version: 105.2
Component: Latest version (1.1.3) (It did not happen in 1.1.1)
Devices: 4CH Pro (2 of them)
Firmware: 3.3.0

switch:
  - platform: sonoff_lan_mode_r3
    name: sonoff_4chr2_XXXXXXXXXX_0
    device_id: XXXXXXXXXX
    api_key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
    icon: mdi:lightbulb
    outlet: 0
  - platform: sonoff_lan_mode_r3
    name: sonoff_4chr2_XXXXXXXXXX_1
    device_id: XXXXXXXXXX
    api_key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
    icon: mdi:lightbulb
    outlet: 1
  - platform: sonoff_lan_mode_r3
    name: sonoff_4chr2_XXXXXXXXXX_2
    device_id: XXXXXXXXXX
    api_key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
    icon: mdi:lightbulb
    outlet: 2
  - platform: sonoff_lan_mode_r3
    name: sonoff_4chr2_XXXXXXXXXX_3
    device_id: XXXXXXXXXX
    api_key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
    icon: mdi:lightbulb
    outlet: 3
  - platform: sonoff_lan_mode_r3
    name: sonoff_4chr2_YYYYYYYYYY_1
    device_id: YYYYYYYYYY
    api_key: yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy
    icon: mdi:lightbulb
    outlet: 1
  - platform: sonoff_lan_mode_r3
    name: sonoff_4chr2_YYYYYYYYYY_0
    device_id: YYYYYYYYYY
    api_key: yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy
    icon: mdi:lightbulb
    outlet: 0
  - platform: sonoff_lan_mode_r3
    name: sonoff_4chr2_YYYYYYYYYY_2
    device_id: YYYYYYYYYY
    api_key: yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy
    icon: mdi:lightbulb
    outlet: 2
  - platform: sonoff_lan_mode_r3
    name: sonoff_4chr2_YYYYYYYYYY_3
    device_id: YYYYYYYYYY
    api_key: yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy
    icon: mdi:lightbulb
    outlet: 3

The 4CH Pro are multichannel devices. About once a day, most (but not all) the channels in each device become unavailable in HA. That seems weird to me. If the devices were really unavailable all the channels should be marked as such (besides,the devices are available in ewelink app). Moreover, as soon as I toggle one of the available channels in HA, the rest of the channels in the device instantly become available. All of this leads me to believe it is a bug in the component, and not a problem in the network.

This is a link to the debug trace, if you are interested:
https://pastebin.com/NrYCkse6

The relevant parts are at times 2020-02-18 23:26:54 (when the devices become unavailable) and 2020-02-18 23:44:31 (when I toggle one of the channels and the rest become available).

Let me know if I can be of further assistance.
Regards.
Javier

Switch unavailable after upgrade to 0.112.3

Hello,
After upgrading Homeassistant to 0.112.3 the switch shows as unavailable in the UI. Below is the relevant log output and my config. Any idea what might be causing this?

Thanks,
Uli

My config:
switch:

  • platform: sonoff_lan_mode_r3
    host: 192.168.2.53
    name: 'Heater Livingroom'
    device_id: someid
    api_key: somekey

Log:
Jul 07 13:52:27 hass[27151]: 2020-07-07 13:52:27 DEBUG (MainThread) [custom_components.sonoff_lan_mode_r3.switch] Initializing SonoffLANModeClient class in SonoffDevice
Jul 07 13:52:27 hass[27151]: 2020-07-07 13:52:27 DEBUG (MainThread) [custom_components.sonoff_lan_mode_r3.switch] HassSonoffSwitch init finished creating SonoffSwitch
Jul 07 13:52:27 hass[27151]: 2020-07-07 13:52:27 DEBUG (MainThread) [custom_components.sonoff_lan_mode_r3.switch] enter send_availability_loop()
Jul 07 13:52:27 hass[27151]: 2020-07-07 13:52:27 DEBUG (MainThread) [custom_components.sonoff_lan_mode_r3.switch] waiting for connection
Jul 07 13:52:27 hass[27151]: 2020-07-07 13:52:27 DEBUG (MainThread) [custom_components.sonoff_lan_mode_r3.switch] send_updated_params_loop is active on the event loop
Jul 07 13:52:27 hass[27151]: 2020-07-07 13:52:27 DEBUG (MainThread) [custom_components.sonoff_lan_mode_r3.switch] Starting loop waiting for device params to change
Jul 07 13:52:27 hass[27151]: 2020-07-07 13:52:27 DEBUG (MainThread) [custom_components.sonoff_lan_mode_r3.switch] send_updated_params_loop now awaiting event
Jul 07 13:52:27 hass[27151]: 2020-07-07 13:52:27 WARNING (zeroconf-ServiceBrowser__ewelink._tcp.local._2795824224) [zeroconf] Error sending through socket 10
Jul 07 13:52:27 hass[27151]: Traceback (most recent call last):
Jul 07 13:52:27 hass[27151]: File "/opt/homeassistant/lib/python3.7/site-packages/zeroconf/init.py", line 2792, in send
Jul 07 13:52:27 hass[27151]: bytes_sent = s.sendto(packet, 0, (real_addr, port))
Jul 07 13:52:27 hass[27151]: OSError: [Errno 126] Required key not available
Jul 07 13:52:27 hass[27151]: 2020-07-07 13:52:27 DEBUG (MainThread) [custom_components.sonoff_lan_mode_r3.switch] HassSonoffSwitch async_update called
Jul 07 13:52:27 hass[27151]: 2020-07-07 13:52:27 DEBUG (MainThread) [custom_components.sonoff_lan_mode_r3.switch] Sonoff device basic info still none, waiting for init message
Jul 07 13:52:27 hass[27151]: 2020-07-07 13:52:27 DEBUG (MainThread) [custom_components.sonoff_lan_mode_r3.switch] HassSonoffSwitch returning _name: Heater Livingroom
Jul 07 13:52:27 hass[27151]: 2020-07-07 13:52:27 DEBUG (MainThread) [custom_components.sonoff_lan_mode_r3.switch] HassSonoffSwitch returning _available: False
Jul 07 13:52:27 hass[27151]: 2020-07-07 13:52:27 DEBUG (MainThread) [custom_components.sonoff_lan_mode_r3.switch] HassSonoffSwitch returning _name: Heater Livingroom
Jul 07 13:52:28 hass[27151]: Exception in thread zeroconf-ServiceBrowser__ewelink._tcp.local._2795824224:
Jul 07 13:52:28 hass[27151]: Traceback (most recent call last):
Jul 07 13:52:28 hass[27151]: File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner
Jul 07 13:52:28 hass[27151]: self.run()
Jul 07 13:52:28 hass[27151]: File "/opt/homeassistant/lib/python3.7/site-packages/zeroconf/init.py", line 1679, in run
Jul 07 13:52:28 hass[27151]: state_change=service_type_state_change[1],
Jul 07 13:52:28 hass[27151]: File "/opt/homeassistant/lib/python3.7/site-packages/zeroconf/init.py", line 1433, in fire
Jul 07 13:52:28 hass[27151]: h(**kwargs)
Jul 07 13:52:28 hass[27151]: File "/opt/homeassistant/lib/python3.7/site-packages/zeroconf/init.py", line 1531, in on_change
Jul 07 13:52:28 hass[27151]: listener.add_service(*args)
Jul 07 13:52:28 hass[27151]: File "/opt/homeassistant/lib/python3.7/site-packages/pysonofflanr3/client.py", line 118, in add_service
Jul 07 13:52:28 hass[27151]: found_ip = utils.parseAddress(info.address)
Jul 07 13:52:28 hass[27151]: AttributeError: 'ServiceInfo' object has no attribute 'address'

Add power fields for S31

2019-12-07 17:02:54 DEBUG (zeroconf-ServiceBrowser_eWeLink_1000384980._ewelink._tcp.local.) [homeassistant.components.switch.sonoff_lan_mode_r3] properties: {b'txtvers': b'1', b'id': b'1000384980', b'type': b'enhanced_plug', b'apivers': b'1', b'seq': b'76', b'encrypt': True, b'iv': b'MjY5NTgzOTY3OTk1MjIxNg==', b'data1': b'PC0ZqdwYHreHvN6XgWbqpffQBQOdalxy3WZedFSa+0+1YCyijOXg2FG4FS+xsOC6odz07YiM4FB/3cfQbxk28eRoH2BRAaVz7Y+9Jn/HwIPzEb6e6lI8IyGdAfcRSKQdUzAqBWwKX279azy9lZTh6zsyHg6g4gT1+CK9lid8FD/yKUr8xUUl+5j59uP2XP/YNlKeHW9mnu6pcM7YpM8uFM5JsrC67f9buauFLp4dsnQ2d3Dsa+yddbpjJ', b'data2': b'U6GrMKS'}
2019-12-07 17:02:54 DEBUG (zeroconf-ServiceBrowser_eWeLink_1000384980._ewelink._tcp.local.) [homeassistant.components.switch.sonoff_lan_mode_r3] type: b'enhanced_plug'
2019-12-07 17:02:54 DEBUG (zeroconf-ServiceBrowser_eWeLink_1000384980._ewelink._tcp.local.) [homeassistant.components.switch.sonoff_lan_mode_r3] decrypted data: b'{"alarmVValue":[-1,-1],"alarmCValue":[-1,-1],"alarmPValue":[-1,-1],"switch":"off","startup":"stay","pulse":"off","pulseWidth":500,"sledOnline":"on","power":0,"voltage":118.72,"current":0}'
2019-12-07 17:02:54 DEBUG (MainThread) [homeassistant.components.switch.sonoff_lan_mode_r3] enter handle_mesage()
2019-12-07 17:02:54 ERROR (MainThread) [homeassistant.components.switch.sonoff_lan_mode_r3] Unknown message received from device:

various switch

How to add multiple Sonoff switches in Home assistant?

HACS compatibility

Is it possible to make this custom component compatible with HACS?
Thanks in advance!

Problems with 0.110b0

Hi
I just installed the new beta 0.110 on my reserve system. The component doesn't work and I get the following error

Logger: homeassistant.components.switch
Source: components/switch/init.py:125
Integration: Kontakt (documentation, issues)
First occurred: 19.02.56 (1 occurrences)
Last logged: 19.02.56

SwitchDevice is deprecated, modify HassSonoffSwitchR3 to extend SwitchEntity

Just thought I would tell you as problems probably will appear when everybody upgrades in a week or so.
/Lars

Unresponsive Sonoff Basic switch

Sonoff Basic (R1 - FW:3.3.0. - PSF-B01-GL) switch is added to Home Assistant (Hass.io on RPi3 B+ - HA version 0.104.3) with the latest version of this component manually copied to /custom_components/ folder.

configuration.yaml file is as follows:
- platform: sonoff_lan_mode_r3
name: "TV_under_LED"
device_id: 1000a74e04
api_key: !secret sonoff_api_key_1000a74e04

The switch was visible in HA at the begining but after I have toggle it's state through Ewelink app on my phone. Then I was able to control the switch for some time, but I have noticed a lag in sending commands to switch and receiving status from it. Then the switch state in HA goes to Unavailable as you can see in the picture below:
image
After restarting HA the status is were present for brief time but then once again Unavailable.
Also I have noticed when the switch was available when I toggle the switch from HA the action take place several minutes after...
The loggs are:
Service 1000a74e04 removed
9:30 AM /usr/local/lib/python3.7/site-packages/pysonofflanr3/client.py (WARNING)
Connection issue for device 1000a74e04: HTTPConnectionPool(host='192.168.0.32', port=8081): Max retries exceeded with url: /zeroconf/switch (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x6d72a350>: Failed to establish a new connection: [Errno 111] Connection refused'))
9:29 AM main.py (WARNING)

And more detailed (debug) one:
2020-01-29 09:25:26 DEBUG (zeroconf-ServiceBrowser__ewelink._tcp.local.) [homeassistant.components.switch.sonoff_lan_mode_r3] Service eWeLink_10005677b8._ewelink._tcp.local. updated (not our switch)
2020-01-29 09:25:26 DEBUG (zeroconf-ServiceBrowser__ewelink._tcp.local.) [homeassistant.components.switch.sonoff_lan_mode_r3] Service eWeLink_100063a1ff._ewelink._tcp.local. updated (not our switch)
2020-01-29 09:25:26 DEBUG (zeroconf-ServiceBrowser__ewelink._tcp.local.) [homeassistant.components.switch.sonoff_lan_mode_r3] Service eWeLink_1000636c23._ewelink._tcp.local. updated (not our switch)
2020-01-29 09:25:26 INFO (zeroconf-ServiceBrowser__ewelink._tcp.local.) [homeassistant.components.switch.sonoff_lan_mode_r3] Service type _ewelink._tcp.local. of name eWeLink_1000a74e04._ewelink._tcp.local. added
2020-01-29 09:25:26 DEBUG (zeroconf-ServiceBrowser__ewelink._tcp.local.) [homeassistant.components.switch.sonoff_lan_mode_r3] service is at 192.168.0.32:8081
2020-01-29 09:25:26 DEBUG (zeroconf-ServiceBrowser__ewelink._tcp.local.) [homeassistant.components.switch.sonoff_lan_mode_r3] properties: {b'txtvers': b'1', b'id': b'1000a74e04', b'type': b'plug', b'apivers': b'1', b'seq': b'95', b'encrypt': True, b'iv': b'NDc0MzA4MzcwNzc1NzYzNg==', b'data1': b'2BkN3fiFx8YxjkWWEe7HMztOxABIWrCA0oCCQt/rdmL1wVJRZ3UtfR2HE6/tVBE9ZGXirpOAScsGwwD3chsxkH/KUtQsgCkhu5cc7Jq8P+uyhRpc+cWqGIXnyMz6m8NA'}
2020-01-29 09:25:26 DEBUG (zeroconf-ServiceBrowser__ewelink._tcp.local.) [homeassistant.components.switch.sonoff_lan_mode_r3] type: b'plug'
2020-01-29 09:25:26 DEBUG (zeroconf-ServiceBrowser__ewelink._tcp.local.) [homeassistant.components.switch.sonoff_lan_mode_r3] decrypted data: b'{"switch":"off","startup":"off","pulse":"off","sledOnline":"on","pulseWidth":500,"rssi":-42}'
2020-01-29 09:25:26 DEBUG (MainThread) [homeassistant.components.switch.sonoff_lan_mode_r3] enter handle_message() b'{"switch":"off","startup":"off","pulse":"off","sledOnline":"on","pulseWidth":500,"rssi":-42}'
2020-01-29 09:25:26 DEBUG (zeroconf-ServiceBrowser__ewelink._tcp.local.) [homeassistant.components.switch.sonoff_lan_mode_r3] properties: {b'txtvers': b'1', b'id': b'1000a74e04', b'type': b'plug', b'apivers': b'1', b'seq': b'95', b'encrypt': True, b'iv': b'NDc0MzA4MzcwNzc1NzYzNg==', b'data1': b'2BkN3fiFx8YxjkWWEe7HMztOxABIWrCA0oCCQt/rdmL1wVJRZ3UtfR2HE6/tVBE9ZGXirpOAScsGwwD3chsxkH/KUtQsgCkhu5cc7Jq8P+uyhRpc+cWqGIXnyMz6m8NA'}
2020-01-29 09:25:26 DEBUG (MainThread) [homeassistant.components.switch.sonoff_lan_mode_r3] Message: Received status from device, storing in instance
2020-01-29 09:25:26 DEBUG (zeroconf-ServiceBrowser__ewelink._tcp.local.) [homeassistant.components.switch.sonoff_lan_mode_r3] type: b'plug'
2020-01-29 09:25:26 INFO (MainThread) [homeassistant.components.switch.sonoff_lan_mode_r3] unsolicited update received from switch: off
2020-01-29 09:25:26 DEBUG (zeroconf-ServiceBrowser__ewelink._tcp.local.) [homeassistant.components.switch.sonoff_lan_mode_r3] decrypted data: b'{"switch":"off","startup":"off","pulse":"off","sledOnline":"on","pulseWidth":500,"rssi":-42}'
2020-01-29 09:25:26 DEBUG (MainThread) [homeassistant.components.switch.sonoff_lan_mode_r3] Switch update pre-callback filter running
2020-01-29 09:25:26 DEBUG (zeroconf-ServiceBrowser__ewelink._tcp.local.) [homeassistant.components.switch.sonoff_lan_mode_r3] Service eWeLink_1000568b68._ewelink._tcp.local. updated (not our switch)
2020-01-29 09:25:26 DEBUG (MainThread) [homeassistant.components.switch.sonoff_lan_mode_r3] Not inching switch, calling parent callback
2020-01-29 09:25:26 DEBUG (zeroconf-ServiceBrowser__ewelink._tcp.local.) [homeassistant.components.switch.sonoff_lan_mode_r3] Service eWeLink_10004f5b71._ewelink._tcp.local. updated (not our switch)
2020-01-29 09:25:26 INFO (MainThread) [homeassistant.components.switch.sonoff_lan_mode_r3] Sonoff LAN Mode switch TV_under_LED received updated state from the device: OFF, available: True
2020-01-29 09:25:26 DEBUG (MainThread) [homeassistant.components.switch.sonoff_lan_mode_r3] HassSonoffSwitch async_update called
2020-01-29 09:25:26 DEBUG (MainThread) [homeassistant.components.switch.sonoff_lan_mode_r3] connected event, sending update
2020-01-29 09:25:26 DEBUG (MainThread) [homeassistant.components.switch.sonoff_lan_mode_r3] waiting for disconnection
2020-01-29 09:25:26 DEBUG (MainThread) [homeassistant.components.switch.sonoff_lan_mode_r3] HassSonoffSwitch returning _available: True
2020-01-29 09:25:26 DEBUG (MainThread) [homeassistant.components.switch.sonoff_lan_mode_r3] HassSonoffSwitch returning _state: False
2020-01-29 09:25:26 DEBUG (MainThread) [homeassistant.components.switch.sonoff_lan_mode_r3] HassSonoffSwitch returning _name: TV_under_LED
2020-01-29 09:25:26 DEBUG (MainThread) [homeassistant.components.switch.sonoff_lan_mode_r3] enter handle_message() b'{"switch":"off","startup":"off","pulse":"off","sledOnline":"on","pulseWidth":500,"rssi":-42}'
2020-01-29 09:25:26 DEBUG (MainThread) [homeassistant.components.switch.sonoff_lan_mode_r3] Message: Received status from device, storing in instance
2020-01-29 09:25:26 INFO (MainThread) [homeassistant.components.switch.sonoff_lan_mode_r3] unsolicited update received from switch: off

If you need anything else please let me know.
Best regards,
Mario

Add auto discovery support

With V3 firmware, the device announces itself on the network with mDNS. This can be used to implement auto discovery for home assistant, though it needs some fairly significant refactoring to enable this. See #8

Home-Assistant not recognizing successful action

First of all, great project!

I have a custom installation of HA on CentOS 7 in Python virtual environment. I've added this module to HA and it successfully loaded it. However, there is a specific following issue happening.

Switch initial state is OFF:
I try to turn on the switch from HA, the switch WILL turn itself ON.
Switch will (supposedly) send update status which is received by HA but that status is not updated, maybe not recognized? The "On/Off" slider on HA web page will revert to off and following log entry is noted after enabling debug log and after successful switch "turn on" action:

Apr 13 19:13:40 homeassistant hass: 2020-04-13 19:13:40 DEBUG (SyncWorker_4) [custom_components.sonoff_lan_mode_r3.switch] response received: <Response [200]> b'{"seq":2,"sequence":"1586798020116","error":0}'

200 message should indicate success, however, HA doesn't seem to recognize it.
Periodically, following will appear in log:

Apr 13 19:20:40 homeassistant hass: 2020-04-13 19:20:40 DEBUG (MainThread) [custom_components.sonoff_lan_mode_r3.switch] send_updated_params_loop now awaiting event
Apr 13 19:20:40 homeassistant hass: 2020-04-13 19:20:40 DEBUG (MainThread) [custom_components.sonoff_lan_mode_r3.switch] Connected!
Apr 13 19:20:40 homeassistant hass: 2020-04-13 19:20:40 DEBUG (MainThread) [custom_components.sonoff_lan_mode_r3.switch] params: {'switch': 'on'}
Apr 13 19:20:40 homeassistant hass: 2020-04-13 19:20:40 DEBUG (MainThread) [custom_components.sonoff_lan_mode_r3.switch] encrypted: {'sequence': '1586798440691', 'deviceid': '100082e44f', 'selfApikey': '123', 'iv': 'jQdNdlUcr+hOwGf4AcJO6Q==', 'encrypt': True, 'data': '9LobXxiu43PZ9dt9l7p2JQ=='}
Apr 13 19:20:40 homeassistant hass: 2020-04-13 19:20:40 DEBUG (SyncWorker_1) [custom_components.sonoff_lan_mode_r3.switch] Sending http message to http://192.168.0.22:8081/zeroconf/switch: {"sequence":"1586798440691","deviceid":"100082e44f","selfApikey":"123","iv":"jQdNdlUcr+hOwGf4AcJO6Q==","encrypt":true,"data":"9LobXxiu43PZ9dt9l7p2JQ=="}
Apr 13 19:20:40 homeassistant hass: 2020-04-13 19:20:40 DEBUG (MainThread) [custom_components.sonoff_lan_mode_r3.switch] Connection issue for device 100082e44f: HTTPConnectionPool(host='192.168.0.22', port=8081): Max retries exceeded with url: /zeroconf/switch (Caused by ProtocolError('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer')))

...and looping
If i try to turn off the switch from eWeLink app BEFORE "Max retries" occurs, device will receive On request from HA again but still not update it's status on HA page.

I don't know why is this happening, however the switch is not standard Sonoff switch, so maybe that's the reason. It is based on 3.x firmware and manufactured by coolkit.

Bellow is my entry in configuration.yml

switch:
  - platform: sonoff_lan_mode_r3
    name: Ventil - Dvoriste
    device_id: 100082e44f
    api_key: ffffffff-ffff-ffff-ffff-ffffffffffff # not needed for devices in DIY mode
    icon: mdi:lightbulb
    outlet: 0

I captured apikey by connecting laptop to WiFi of switch during pairing mode and then captured the handshake using wireshark while pairing the device from eWeLink app from another device, so apikey is supposed to be ok. Well, then again, if it wasn't correct, switch would not even turn on the first time.

If there is ANYTHING i can do to help troubleshoot this further on , please let me know ! I would do whatever is needed.

Platform error switch.sonoff_lan_mode_r3

Hello. I customize Home Assistant 0.107.7
Added settings in configuration.yaml for adding Sonoff mini relays. When checking received the following error:
2020-04-07 19:41:42 ERROR (MainThread) [homeassistant.components.hassio] Platform error switch.sonoff_lan_mode_r3 - Integration 'sonoff_lan_mode_r3' not found.

configuration.yaml
switch:

  • platform: sonoff_lan_mode_r3
    name: Sonoff
    device_id: 1000хххххх
    icon: // [Optional] Custom icon for device
    outlet: 0

image

Refactor code so there is only a single platform running

At the moment the code is loaded once per switch.

Changing it so that there is only a single platform will improve performance and also pave the way for enhancements such as autodiscovery, which should now be feasible with the DIY devices as you don't need to sniff for the API key

BASE Encde error

I get this error

Error decrypting for device 10007ba148: Invalid base64-encoded string: number of data characters (249) cannot be 1 more than a multiple of 4, probably wrong API key

Support iFan03

I use latest from master branch...

- platform: sonoff_lan_mode_r3
  name: Luz Sala
  device_id: 1000954607
  api_key: !secret ventilador_sala_api_key
  outlet: 0
- platform: sonoff_lan_mode_r3
  name: Ventilador Sala
  device_id: 1000954607
  api_key: !secret ventilador_sala_api_key
  outlet: 1
- platform: sonoff_lan_mode_r3
  name: Velocidade 3 Sala
  device_id: 1000954607
  api_key: !secret ventilador_sala_api_key
  outlet: 3

Log:
https://termbin.com/qx08

Error repeated multiple times in HA log

HA Version: 103.5
Component: Latest version (installed 2 days ago)

Configuration.yaml:
`switch:

  • platform: sonoff_lan_mode_r3
    name: Farola Casa
    device_id: XXXXXXXXXX
    api_key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
    icon: mdi:lightbulb
    outlet: 0
  • platform: sonoff_lan_mode_r3
    name: Farola Esq. Abajo
    device_id: XXXXXXXXXX
    api_key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
    icon: mdi:lightbulb
    outlet: 1
  • platform: sonoff_lan_mode_r3
    name: Farolas Abajo
    device_id: XXXXXXXXXX
    api_key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
    icon: mdi:lightbulb
    outlet: 2
  • platform: sonoff_lan_mode_r3
    name: Farola Escalera
    device_id: XXXXXXXXXX
    api_key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
    icon: mdi:lightbulb
    outlet: 3
    `
    Error repeated multiple times in log:
    Retry_connection() Unexpected error for device XXXXXXXXXX: 'switch' <function format_exc at 0xb6a2ee40>

Integration fails in HA 0.97.2

Hello,

I've an error when trying this component in Home Assistant v0.97.2:

Integration sonoff_lan_mode_r3 not found when trying to verify its switch platform.

I tried to put an __init__.py but still the same error.

Thanks.

Trigger does not work with Home Assistant v0.109

Devices are visible, device status is updating, but I cannot trigger them

Debug output on trigger:

2020-04-29 22:13:57 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: domain=switch, service=turn_off, service_data=entity_id=switch.lights_aqua_main>

2020-04-29 22:13:57 DEBUG (MainThread) [custom_components.sonoff_lan_mode_r3.switch] HassSonoffSwitch returning _available: True

Unknown Message for Sonoff S31

Have configured a few Sonoff S31 (w/ power monitoring) due to the recent fun w/ Sonoff and lengthier delays between updates.

Am now seeing the devices in HomeAssistant, but they are coming back as unavailable. I have checked the IDs and API keys a few times and don't believe this to be the problem.

Here's a sample of what I'm seeing in the debug log:
2019-12-07 17:26:52 DEBUG (zeroconf-ServiceBrowser_eWeLink_10003845b1._ewelink._tcp.local.) [homeassistant.components.switch.sonoff_lan_mode_r3] properties: {b'txtvers': b'1', b'id': b'10003845b1', b'type': b'enhanced_plug', b'apivers': b'1', b'seq': b'13', b'encrypt': True, b'iv': b'OTg1MjQxNjg5MzAzMjk4Nw==', b'data1': b'ZDISiB2QSKWyWEsrmUkBgF9fvHMU/tlrh53X6wnLefCpbGjxJAF4u4KvCrRQ//jFuxE4/z0Ox82WLr6Ye1nx2os58CErLOQLczD0TFcUlUHwp8D5jQ6TsoOVsbdtDJX33FR6RIaXWs1w73V6d08E1Fy39++9kAVZPV/5tJ1Ms1rP3f7E43NlG/PrWt72x3S7F/VKWepo2JjRAqOwuFNaDWHAiDwlDKP2iu447v0QBMOijdqp1JL8cNy32', b'data2': b'0En0UOe'} 2019-12-07 17:26:52 DEBUG (zeroconf-ServiceBrowser_eWeLink_10003845b1._ewelink._tcp.local.) [homeassistant.components.switch.sonoff_lan_mode_r3] type: b'enhanced_plug' 2019-12-07 17:26:52 DEBUG (zeroconf-ServiceBrowser_eWeLink_10003845b1._ewelink._tcp.local.) [homeassistant.components.switch.sonoff_lan_mode_r3] decrypted data: b'{"alarmVValue":[-1,-1],"alarmCValue":[-1,-1],"alarmPValue":[-1,-1],"switch":"off","startup":"stay","pulse":"off","pulseWidth":500,"sledOnline":"on","power":0,"voltage":119.56,"current":0}' 2019-12-07 17:26:52 DEBUG (MainThread) [homeassistant.components.switch.sonoff_lan_mode_r3] enter handle_mesage() 2019-12-07 17:26:52 ERROR (MainThread) [homeassistant.components.switch.sonoff_lan_mode_r3] Unknown message received from device:
I'm noting they are on firmware 3.3.1 so potentially a version newer than what is listed as supported (and I'm sure no way to downgrade so I may just be stuck...)

Initial Update

The bot created this issue to inform you that pyup.io has been set up on this repo.
Once you have closed it, the bot will open pull requests for updates as soon as they are available.

After HomeAssistant update, using HA to turn on/off switches not working

Hello,

I did an update of my home assistant today, to 0.109.2, and now it seems my ability to control switches from HA has stopped working. If I switch them by hand, HA does notice, and update their status.

When I look at the logs of the docker container, I see this when I try to switch a switch:

2020-05-02 23:00:39 DEBUG (MainThread) [homeassistant.components.switch.sonoff_lan_mode_r3] HassSonoffSwitch returning _available: True
/usr/local/lib/python3.7/asyncio/base_events.py:1787: RuntimeWarning: coroutine 'HassSonoffSwitchR3.turn_off' was never awaited
  handle = None  # Needed to break cycles when an exception occurs.
RuntimeWarning: Enable tracemalloc to get the object allocation traceback```

Any ideas?

I've just updated my HA to have the latest master of this repo too.

Devices Unavailable after each HA restart

I'm running HA (Hass.io on RPi3B+, current version is 0.108.8) and I have noticed now every time when HA restarts all of my Sonoff devices are Unavailable. I need to go to Ewelink app on my phone and just open the app and then all the devices are immediately visible in HA. I don't know if it has something with HA or even with newest version of Ewelink Android app now is version 4.0.2.

Device offline most of the time

My device (Sonoff Basic / fw v3.x) ) only comes visible/online a couple of times per day, and only very briefly - a couple of minutes max ...

ifan02 don't work

I use latest sonoff_lan_mode_r3.zip from master branch with switch.py (latest) from root repo...

Config (switchs.yaml):

- platform: sonoff_lan_mode_r3
  name: ifan02 Outlet 0
  device_id: 100065d0d6
  api_key: !secret ventilador_sala_api_key
  outlet: 0
- platform: sonoff_lan_mode_r3
  name: ifan02 Sala Outlet 1
  device_id: 100065d0d6
  api_key: !secret ventilador_sala_api_key
  outlet: 1
- platform: sonoff_lan_mode_r3
  name: ifan02 Sala Outlet 2
  device_id: 100065d0d6
  api_key: !secret ventilador_sala_api_key
  outlet: 2
- platform: sonoff_lan_mode_r3
  name: ifan02 Sala Outlet 3
  device_id: 100065d0d6
  api_key: !secret ventilador_sala_api_key
  outlet: 3

Log (debug): https://pastebin.com/c80kYxC3

Add sensor information for Sonoff TH16

Config:

switch:
  - platform: sonoff_lan_mode_r3
    device_id: 10007bf475
    api_key: 7d6dff19-fef7-4d11-9094-5658add22c13

Log message:

2019-12-15 14:03:59 INFO (zeroconf-ServiceBrowser__ewelink._tcp.local.) [homeassistant.components.switch.sonoff_lan_mode_r3] Service type _ewelink._tcp.local. of name eWeLink_10007bf475._ewelink._tcp.local. added
2019-12-15 14:03:59 DEBUG (zeroconf-ServiceBrowser__ewelink._tcp.local.) [homeassistant.components.switch.sonoff_lan_mode_r3] service is at 192.168.0.103:8081
2019-12-15 14:03:59 DEBUG (zeroconf-ServiceBrowser__ewelink._tcp.local.) [homeassistant.components.switch.sonoff_lan_mode_r3] properties: {b'txtvers': b'1', b'id': b'10007bf475', b'type': b'th_plug', b'apivers': b'1', b'seq': b'569', b'encrypt': True, b'iv': b'MjgwNTY2MjI1NTY0MDUzOQ==', b'data1': b'KZI8x5XJTQKyoXrORx/aINzg8ZBNJ1BuEKuLOIpkscu+AVhoXYpLOh94ViX9MnSYZen/6ta+JdbAAhvkJwDAAuX/c6Bqy1fXJU0JZjrprHrfH5ymcVAqHklshmk0t8OgkKbj6kNyFO1nZIvHKGgHy8mgS1rrPWzwqz5BTVZJ8tGulygjsBIEw96nBQ1sHNdTz7S6K49YThFl2Lv+6ZP5CQ=='}
2019-12-15 14:03:59 DEBUG (zeroconf-ServiceBrowser__ewelink._tcp.local.) [homeassistant.components.switch.sonoff_lan_mode_r3] type: b'th_plug'
2019-12-15 14:03:59 DEBUG (zeroconf-ServiceBrowser__ewelink._tcp.local.) [homeassistant.components.switch.sonoff_lan_mode_r3] decrypted data: b'{"deviceType":"normal","switch":"off","startup":"off","pulse":"off","pulseWidth":500,"sledOnline":"off","sensorType":"AM2301","humidity":86,"temperature":28}'
2019-12-15 14:04:00 DEBUG (MainThread) [homeassistant.components.switch.sonoff_lan_mode_r3] HassSonoffSwitch returning _name: Sonoff Switch
2019-12-15 14:04:00 DEBUG (MainThread) [homeassistant.components.switch.sonoff_lan_mode_r3] enter handle_mesage()
2019-12-15 14:04:00 ERROR (MainThread) [homeassistant.components.switch.sonoff_lan_mode_r3] Unknown message received from device:

Does not appear as a switch so I can configure the entity.
What can it be?

Sonoff Basic R3 DIY mode labeled as unavaliable on Hassio 0.101.3

When installed the component, the switch is found but it is labeled as unavailable.
Also I am not sure if it is required that the Basic R3 is set to LAN mode before installing the component.

Following is the related part of the configuration file:

switch:
  - platform: sonoff_lan_mode_r3
    name: Lampada
    device_id: 1000900a87
    icon: mdi:lightbulb

inching support

Hello,

first awsome work! I changed a bit the component to activate inching, but not that simple as expected, HA seems to be lost and switch start blinking in loop :)

Any chance you can activate this support ?
Indeed I m using the switch to control the pool pump, and even if I m turning on and off the pump with your component, I would like to use long inching in case I lose completly HA, so that at some point the pump should turn off by itself :)

thks in advance!

Matt

Initial Update

The bot created this issue to inform you that pyup.io has been set up on this repo.
Once you have closed it, the bot will open pull requests for updates as soon as they are available.

Mini 3.5.0 not working

Config

logger:
  default: warn
  logs:
    custom_components.sonoff_lan_mode_r3: debug

switch:
  - platform: sonoff_lan_mode_r3
    name: sonoff_mini_1
    device_id: 1000983e3c
    icon: mdi:lightbulb

Log


Logger: custom_components.sonoff_lan_mode_r3.switch
Source: /usr/local/lib/python3.7/site-packages/pysonofflanr3/client.py:201
First occurred: 3:12:10 (5 occurrences)
Last logged: 4:02:05

Missing api_key for encrypted device: eWeLink_1000983e3c._ewelink._tcp.local.

in DIY mode

Maybe this is due to protocol version 2.0?
https://github.com/itead/Sonoff_Devices_DIY_Tools/blob/master/SONOFF%20DIY%20MODE%20Protocol%20Doc%20v2.0%20Doc.pdf

Add sensor information for ifan02

Config:

  - platform: sonoff_lan_mode_r3
    name: ifan02
    device_id: 100065d0d6
    api_key: 444daa51-d78c-4802-8463-663bd2788f70

Log:

2019-12-15 16:50:01 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for sonoff_lan_mode_r3 which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant.
2019-12-15 16:50:02 DEBUG (MainThread) [homeassistant.components.switch.sonoff_lan_mode_r3] Initializing SonoffLANModeClient class in SonoffDevice
2019-12-15 16:50:02 DEBUG (MainThread) [homeassistant.components.switch.sonoff_lan_mode_r3] HassSonoffSwitch init finished creating SonoffSwitch
2019-12-15 16:50:02 INFO (zeroconf-ServiceBrowser__ewelink._tcp.local.) [homeassistant.components.switch.sonoff_lan_mode_r3] Service type _ewelink._tcp.local. of name eWeLink_100065d0d6._ewelink._tcp.local. added
2019-12-15 16:50:02 DEBUG (zeroconf-ServiceBrowser__ewelink._tcp.local.) [homeassistant.components.switch.sonoff_lan_mode_r3] service is at 192.168.0.113:8081
2019-12-15 16:50:02 DEBUG (zeroconf-ServiceBrowser__ewelink._tcp.local.) [homeassistant.components.switch.sonoff_lan_mode_r3] properties: {b'txtvers': b'1', b'id': b'100065d0d6', b'type': b'strip', b'apivers': b'1', b'seq': b'11', b'encrypt': True, b'iv': b'MDk5MjQ0MDE4MzAxNTYzOA==', b'data1': b'IQDCz2/RtJmOuFqYNCeDOjaaBHAdi1rCE3XgqZiYutmEdFpaWnW2tMR76bLBGaZ3tU78ZxsjStzNACaeq0TmE1ktruCgUCw8gwmmMxmYH8fz9ejAWsfBBAABWqrTQ+ZsJeyClTfZ2wIT4s/nIQgQtbQELX1ITtrzIM0Bmf9iAmJc0cpJdbk5WQSpMMXn1tEDhPbnF4t0eHSoXzxGb16WKmwDyFjucnwxyOdsoHBjXAGTI5c7ViaQq4v2s', b'data2': b'hApm9dAAzwQKY3R4jm+dze2kNqhGvICuvJzZNcTJC0kWbRnnIcw+nO/G2aHVu9R1jLabdOnu+TCrMdCINSY2FQCLtgQBFgCxHEX2szX9s2NO/BxKGsVB3sFHOrgBIy/Pno+ugmM+MFVlxO5EhNzP64OQhinIou/QEfadnFVbpdZ11NPI9Rp1a3Qpoo9OA0w5d454e9Hd6eYHJMJw8D3UWCRjtT5pWmqq47OHg3nWHpqfk6U/CxM1K+npg', b'data3': b'esLdeinCs1Nr4rcnJALLk1hADxcVZvSgvk6bSh6FAUapslpCoUQ58lNuAV09JAnHboifwNj6q75RsQzkMTVgNokq8UUZ7eaZHN0g=='}
2019-12-15 16:50:02 DEBUG (zeroconf-ServiceBrowser__ewelink._tcp.local.) [homeassistant.components.switch.sonoff_lan_mode_r3] type: b'strip'
2019-12-15 16:50:02 DEBUG (zeroconf-ServiceBrowser__ewelink._tcp.local.) [homeassistant.components.switch.sonoff_lan_mode_r3] decrypted data: b'{"sledOnline":"on","configure":[{"startup":"off","outlet":0},{"startup":"off","outlet":1},{"startup":"off","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":"off","outlet":0},{"switch":"on","outlet":1},{"switch":"off","outlet":2},{"switch":"on","outlet":3}]}'
2019-12-15 16:50:03 DEBUG (MainThread) [homeassistant.components.switch.sonoff_lan_mode_r3] enter send_availability_loop()
2019-12-15 16:50:03 DEBUG (MainThread) [homeassistant.components.switch.sonoff_lan_mode_r3] waiting for connection
2019-12-15 16:50:03 DEBUG (MainThread) [homeassistant.components.switch.sonoff_lan_mode_r3] send_updated_params_loop is active on the event loop
2019-12-15 16:50:03 DEBUG (MainThread) [homeassistant.components.switch.sonoff_lan_mode_r3] Starting loop waiting for device params to change
2019-12-15 16:50:03 DEBUG (MainThread) [homeassistant.components.switch.sonoff_lan_mode_r3] send_updated_params_loop now awaiting event
2019-12-15 16:50:03 DEBUG (MainThread) [homeassistant.components.switch.sonoff_lan_mode_r3] HassSonoffSwitch async_update called
2019-12-15 16:50:03 DEBUG (MainThread) [homeassistant.components.switch.sonoff_lan_mode_r3] Sonoff device basic info still none, waiting for init message
2019-12-15 16:50:03 DEBUG (MainThread) [homeassistant.components.switch.sonoff_lan_mode_r3] HassSonoffSwitch returning _name: ifan02
2019-12-15 16:50:03 DEBUG (MainThread) [homeassistant.components.switch.sonoff_lan_mode_r3] HassSonoffSwitch returning _available: False
2019-12-15 16:50:03 DEBUG (MainThread) [homeassistant.components.switch.sonoff_lan_mode_r3] HassSonoffSwitch returning _name: ifan02
2019-12-15 16:50:03 DEBUG (MainThread) [homeassistant.components.switch.sonoff_lan_mode_r3] enter handle_mesage()
2019-12-15 16:50:03 DEBUG (MainThread) [homeassistant.components.switch.sonoff_lan_mode_r3] Message: Received status from device, storing in instance
2019-12-15 16:50:03 INFO (MainThread) [homeassistant.components.switch.sonoff_lan_mode_r3] unsolicited update received from switch: off
2019-12-15 16:50:03 DEBUG (MainThread) [homeassistant.components.switch.sonoff_lan_mode_r3] Switch update pre-callback filter running
2019-12-15 16:50:03 DEBUG (MainThread) [homeassistant.components.switch.sonoff_lan_mode_r3] Not inching switch, calling parent callback
2019-12-15 16:50:03 INFO (MainThread) [homeassistant.components.switch.sonoff_lan_mode_r3] Sonoff LAN Mode switch ifan02 received updated state from the device: OFF, available: True
2019-12-15 16:50:03 DEBUG (MainThread) [homeassistant.components.switch.sonoff_lan_mode_r3] HassSonoffSwitch async_update called
2019-12-15 16:50:03 DEBUG (MainThread) [homeassistant.components.switch.sonoff_lan_mode_r3] connected event, sending update
2019-12-15 16:50:03 DEBUG (MainThread) [homeassistant.components.switch.sonoff_lan_mode_r3] Switch update pre-callback filter running
2019-12-15 16:50:03 DEBUG (MainThread) [homeassistant.components.switch.sonoff_lan_mode_r3] Not inching switch, calling parent callback
2019-12-15 16:50:03 INFO (MainThread) [homeassistant.components.switch.sonoff_lan_mode_r3] Sonoff LAN Mode switch ifan02 received updated state from the device: OFF, available: True
2019-12-15 16:50:03 DEBUG (MainThread) [homeassistant.components.switch.sonoff_lan_mode_r3] HassSonoffSwitch async_update called
2019-12-15 16:50:03 DEBUG (MainThread) [homeassistant.components.switch.sonoff_lan_mode_r3] waiting for disconnection
2019-12-15 16:50:03 DEBUG (MainThread) [homeassistant.components.switch.sonoff_lan_mode_r3] HassSonoffSwitch returning _available: True
2019-12-15 16:50:03 DEBUG (MainThread) [homeassistant.components.switch.sonoff_lan_mode_r3] HassSonoffSwitch returning _state: False
2019-12-15 16:50:03 DEBUG (MainThread) [homeassistant.components.switch.sonoff_lan_mode_r3] HassSonoffSwitch returning _name: ifan02
2019-12-15 16:50:03 DEBUG (MainThread) [homeassistant.components.switch.sonoff_lan_mode_r3] HassSonoffSwitch returning _name: ifan02
2019-12-15 16:50:03 DEBUG (MainThread) [homeassistant.components.switch.sonoff_lan_mode_r3] HassSonoffSwitch returning _available: True
2019-12-15 16:50:03 DEBUG (MainThread) [homeassistant.components.switch.sonoff_lan_mode_r3] HassSonoffSwitch returning _state: False
2019-12-15 16:50:03 DEBUG (MainThread) [homeassistant.components.switch.sonoff_lan_mode_r3] HassSonoffSwitch returning _name: ifan02

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.