Giter Club home page Giter Club logo

sonofflan's Introduction

Control Sonoff Devices from Home Assistant

hacs_badge

Home Assistant custom component for control Sonoff devices with eWeLink (original) firmware over LAN and/or Cloud.

New features in version 3.0

Features from previous versions

  • can manage both local and cloud control at the same time!
  • support old devices wih 2.7 firmware (only cloud connection)
  • support new device types: color lights, sensors, covers
  • support eWeLink cameras with PTZ
  • support unavailable device state for both local and cloud connection
  • support sensors for Sonoff RF Bridge 433
  • support ZigBee Bridge and Devices
  • added new debug mode for troubleshooting

Pros

  • work with original eWeLink / Sonoff firmware, no need to flash devices
  • work over Local Network and/or Cloud Server
  • work with devices without DIY-mode
  • work with devices in DIY-mode
  • support single and multi-channel devices
  • support TH and Pow device sensors
  • support Sonoff RF Bridge 433 for receive and send commands
  • support Sonoff GK-200MP2-B Camera
  • instant device state update with local Multicast or cloud Websocket connection
  • load devices list from eWeLink Servers (with names and encryption keys) and save it locally
  • (optional) change device type from switch to light

Component review from DrZzs

Sonoffs can work with Home Assistant without changing the Firmware!

There is another great component by @peterbuga, that works with cloud servers.

Thanks to @beveradb and @mattsaxon for researching the local Sonoff protocol. Thanks to @michthom and @EpicLPer for researching the local Sonoff Camera protocol.

Tested Devices

Almost any single or multi-channel Switch working in the eWeLink application will work with this Integration even if it is not on the list.

Tested (LAN and Cloud)

These devices work both on a local network and through the cloud.

Tested (only Cloud)

These devices only work through the cloud!

Tested ZigBee (only Cloud)

  • Sonoff ZigBee Bridge - turn on for pairing mode
  • SONOFF SNZB-01 - Zigbee Wireless Switch
  • SONOFF SNZB-02 - ZigBee Temperature and Humidity Sensor
  • SONOFF SNZB-03 - ZigBee Motion Sensor
  • SONOFF SNZB-04 - ZigBee Wireless door/window sensor

Tested Cameras (only LAN)

Maybe other eWeLink cameras also work, I don’t know.

Installation

HACS > Integrations > Plus > SonoffLAN

Or manually copy sonoff folder from latest release to custom_components folder in your config folder.

Configuration

Configuration > Integrations > Add Integration > Sonoff

If the integration is not in the list, you need to clear the browser cache.

You can setup multiple integrations with different ewelink accounts.

Important. If you use the same account in different smart home systems, you will be constantly unlogged from everywhere. In this case, you need to create a second ewelink account and share your devices or home with it.

Issues

Before posting new issue:

  1. Check the number of online devices on the System Health page
  2. Check warning and errors on the Logs page
  3. Check debug logs on the Debug page (must be enabled in integration options)
  4. Check open and closed issues
  5. Share integration diagnostics (supported from Hass v2022.2):
  • All devices: Configuration > Integrations > Sonoff > 3 dots > Download diagnostics
  • One device: Configuration > Devices > Device > Download diagnostics

There is no private data, but you can delete anything you think is private.

Configuration UI

Configuration > Integrations > Sonoff > Configure

Mode

In auto mode component using both local and cloud connections to your devcies. If device could be reached via LAN - the local connection will be used. Otherwise the cloud connection will be used.

local mode or cloud mode will use only this type of connection.

Sometimes it can be difficult to get a local connection to work. You need a local network with working Multicast (mDNS/zeroconf) traffic between the Hass and your devices. Read about common problems.

Each time the integration starts, a list of user devices is loaded from cloud and saved locally (/config/.storage/sonoff/).

auto mode and local mode can work without Internet connection. If the integration fails to connect to the cloud - the component will use the previously saved list of devices and continue to work only in local mode. auto mode will continue trying to connect to the cloud.

local mode can't work without ewelink credentials because it needs devices encryption keys.

Devices in DIY mode can be used without ewelink credentials because their protocol unencrypted.

It is highly recommended that you use mode: auto and do not use mode: local or DIY mode. Because the local protocol is not always stable and you will get a bad experience. Devices may sometimes disappear from the network or fail to respond to local requests. Also some POW and TH devices cannot update their sensors without a cloud connection.

Debug page

Enable debug page in integration options. Reload integrations page. Open: Integraion > Menu > Known issues.

Debug page shows only integration logs and removes some private data. You can filter log and enable auto refresh (in seconds).

http://192.168.1.123:8123/api/sonoff/c8503fee-88fb-4a18-84d9-abb782bf0aa7?q=1000xxxxxx&r=2

Homes

By default component loads cloud devices only for current active Home in ewelink application. If there is only one Home in the account, it shouldn't be a problem. Otherwise you can select one or multiple Homes to load devices from.

Configuration YAML

These settings are made via YAML.

Important. DeviceID is always 10 symbols string from entity_id or eWeLink app.

Custom device_class

You can convert all switches into light by default:

sonoff:
  default_class: light  # (optional), default switch

You can convert specific switches into light, fan or binary_sensor:

sonoff:
  devices:
    1000xxxxxx:
      device_class: light
      name: Sonoff Basic
    1000yyyyyy:
      device_class: fan
      name: Sonoff Mini

You can convert multi-channel devices (e.g. Sonoff T1 2C):

sonoff:
  devices:
    1000xxxxxx:
      device_class: [light, fan]
      name: Sonoff T1 2C
    1000yyyyyy:
      device_class: [switch, light]
      name: MiniTiger 2CH

You can convert multi-channel device (e.g. Sonoff T1 3C) into single light with brightness control:

sonoff:
  devices:
    1000xxxxxx:
      device_class:
        - light: [1, 2, 3]
      name: Sonoff T1 3C

You can control multiple light zones with single multi-channel device (e.g. Sonoff 4CH):

sonoff:
  devices:
    1000xxxxxx:
      device_class:
        - switch: 1  # entity 1 (channel 1)
        - light: [2, 3]  # entity 2 (channels 2 and 3)
        - fan: 4  # entity 3 (channel 4)
      name: Sonoff 4CH

You can change device_class for Binary Sensor:

sonoff:
  devices:
    1000xxxxxx:
      device_class: window

You can change device_class for Cover:

sonoff:
  devices:
    1000xxxxxx:
      device_class: shutter

You can set the uiid when running in DIY mode to enable the device features. More info here.

sonoff:
  devices:
    1000xxxxxx:
      extra: { uiid: 136 }  # Sonoff B05-BL

Custom devices

sonoff:
  devices:
    1000xxxxxx:
      name: Device name from YAML  # optional rewrite device name
      host: 192.168.1.123  # optional force device IP-address
      devicekey: xxx  # optional encription key (downloaded automatically from the cloud)

Custom sensors

If you want some additional device attributes as sensors:

sonoff:
  sensors: [staMac, bssid, host]

Force update

You can request actual device state and all its sensors manually at any time using homeassistant.update_entity service. Use it with any device entity except sensors. Use it with only one entity from each device.

As example, you can create an automation for forced temperature updates for Sonoff TH:

trigger:
  - platform: time_pattern
    minutes: '3'
action:
  - service: homeassistant.update_entity
    target:
      entity_id: switch.sonoff_1000xxxxxx

Preventing DB size growth

Pow devices may send a lot of data every second. You can reduce the amount of processed data.

For multi-channel devices use power_1, current_2, etc.

sonoff:
  devices:
    1000xxxxxx:
      reporting:
        power: [30, 3600, 1]  # min seconds, max seconds, min delta value
        current: [5, 3600, 0.1]
        voltage: [60, 3600, 5]
  • if new value came before min seconds - it will be "delayed"
  • if new value came between min and max seconds
    • if delta lower than delta value - it will be "delayed"
    • otherwise - it will be used
  • if new value came after max seconds - it will be used
  • any used value will erase "delayed" value
  • new "delayed" value will overwrite old one
  • "delayed" value will be checked for the above conditions every 30 seconds

Sonoff Pow

Support power, current and voltage sensors via LAN and Cloud connections. Also support energy (consumption) sensor only with Cloud connection.

Many models of Sonoff power devices DON'T send power, current and voltage by default. You need to ASK these devices to send this data. This can ONLY be done through a cloud-based request. The mobile app does it. And the integration does it (only in the auto and cloud modes).

By default energy data loads from cloud every hour. You can change interval via YAML and add history data to sensor attributes (max size - 30 days, disable - 0). For multi-channel devices use energy_1, energy_2.

sonoff:
  devices:
    1000xxxxxx:
      reporting:
        energy: [3600, 10]  # update interval (seconds), history size (days)

template:
  - sensor:
      - name: "10 days consumpion"
        unit_of_measurement: "kWh"
        state: "{{ (state_attr('sensor.sonoff_1000xxxxxx_energy', 'history') or [])|sum }}"

You can also setup a integration sensor, that will collect energy data locally by Hass:

sensor:
  - platform: integration
    source: sensor.sonoff_1000xxxxxx_power
    name: energy_spent
    unit_prefix: k
    round: 2

Sonoff TH

Support optional Climate entity that controls Thermostat. You can control low and high temperature values and hvac modes:

  • heat - lower temp enable switch, higher temp disable switch
  • cool - lower temp disable switch, higher temp enable switch
  • dry - change control by humidity with previous low/high switch settings

In dry mode, the Thermostat controls and displays Humidity. But the units are displayed as temperature (Hass limitation).

Thermostat can be controlled only with Cloud connection. Main switch and TH sensors support LAN and Cloud connections.

Sonoff RF Bridge 433

RF Bridge support learning up to 64 signals (16 x 4 buttons).

Video HOWTO from @KPeyanski

Automatic Calls and Messages from Home Assistant, Sonoff RF Bridge and Smoke Detectors

Important. Integration v3 supports automatic creation of sensors for RF Bridge. All buttons will be created as Button entity. All alarms will be created as Binary sensor.

Both button and binary sensor has last_triggered attribute with the time of the last signal received. You can use it in automations.

Binary sensor will stay in on state during 120 seconds by default. Each new signal will reset the timer. Binary sensor support restore state between Hass restarts.

If you has door sensor with two states (for open and for closed state) like this one, you can config payload_off as in the example below. Also disable the timeout if you do not need it in this case (with timeout: 0 option).

You can use any device_class that is supported in Binary Sensor. With device_class: button you can convert sensor to button.

PIR Sensor

sonoff:
  rfbridge:
    PIR Sensor 1:  # button/alarm name in eWeLink application
      device_class: motion
      timeout: 60  # optional (default 120), timeout in seconds for auto turn off

Single State Sensor

sonoff:
  rfbridge:
    Door Sensor 1:  # button/alarm name in eWeLink application
      name: Door Sensor  # optional, you can change sensor name
      device_class: door  # e.g. door, window
      timeout: 5

Dual State Sensor

sonoff:
  rfbridge:
    Sensor1:  # button/alarm name in eWeLink application (open signal)
      name: Window Sensor  # optional, you can change sensor name
      device_class: window  # e.g. door, window
      timeout: 0  # disable auto close timeout
      payload_off: Sensor2  # button/alarm name in eWeLink application (close signal)

You can read more about using this bridge in wiki.

Sonoff GK-200MP2-B Camera

Currently only PTZ commands are supported. Camera entity is not created now.

You can send left, right, up, down commands with sonoff.send_command service:

script:
  left:
    sequence:
      - service: sonoff.send_command
        data:
          device: '012345'  # use quotes, this is important
          cmd: left

device - this is the number from the camera ID EWLK-012345-XXXXX, exactly 6 digits (leading zeros - it is important).

Common problems in only LAN mode

auto mode and cloud mode users don't have these problems.

Devices are not displayed

  • not all devices supports local protocol
  • two routers
  • docker with port forwarding
  • virtual machine with port forwarding
    • you must use bridge virtual network mode (not NAT mode)
  • Oracle VM VirtualBox
  • linux firewall
  • linux network driver
  • incorrect network interface selected in Configuration > Settings > Global > Network

The devices publish their data through Multicast DNS (mDNS/zeroconf), read more.

Devices unavailable after reboot

All devices unavailable after each Home Assistant restart. Devices are automatically detected in the local network after each restart. Sometimes devices appear quickly. Sometimes after a few minutes. If this does not happen, there are some problems with the multicast / router.

Raw commands

The component adds the service sonoff.send_command to send low-level commands.

Example service params to single switch:

device: 1000xxxxxx
switch: 'on'

Example service params to multi-channel switch:

device: 1000xxxxxx
switches: [{outlet: 0, switch: 'off'}]

Example service params to dimmer:

device: 1000123456
cmd: dimmable
switch: 'on'
brightness: 50
mode: 0

Getting devicekey manually

The average user does not need to get the device key manually. The component does everything automatically, using the ewelink account.

  1. Put the device in setup mode
  2. Connect to the Wi-Fi network ITEAD-10000, password 12345678
  3. Open in browser http://10.10.7.1/device
  4. Copy deviceid and apikey (this is devicekey)
  5. Connect to your Wi-Fi network and setup Sonoff via the eWeLink app

Useful Links

sonofflan's People

Contributors

alexxit avatar basnijholt avatar bdraco avatar bencesiposicellmobilsoft avatar cholek3 avatar cybergrimes avatar deltazerorsan avatar frborda avatar gormya avatar hmmbob avatar krahabb avatar ksfreitas avatar leandroissa avatar lukaszp2 avatar mancavemedia avatar masterz69 avatar mderubertis avatar mennovf avatar misa1515 avatar mohamadfala avatar n4dwxihyeyhes2 avatar rainepretorius avatar rany2 avatar sipimokus avatar sophiedeziel avatar spencer-sawyer avatar thomasadelhardt avatar thunderstrike116 avatar wowgamr avatar wrt54g avatar

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  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  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  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

sonofflan's Issues

Sonoff IFan03 support

Hi, First off thank you for your work on this integration it is going to be awesome! I thought I would try out the new Sonoff IFan3 even though it wasn't on the tested list. Couldn't get it to work but saw this in the log so thought I would pass along.

WARNING (zeroconf-ServiceBrowser__ewelink._tcp.local.) [custom_components.sonoff] Please, send this device type to developer: fan_light

Thank you!

Feedback for your ADD ON

For your information, the addon work with:

5 V 12 V Sonoff WiFi Smart Switch Wireless
Sonoff S55

Many thanks for your work!

Installed following instructions but no .json file created

I installed sonofflan following the instructions and Drzzs video, added the "minimal" code to config.yaml, no errors, but no >json file was created in the config folder and no new entities appear in HA.
Any suggestions would be appreciated!

Uodtae 1.10.1 with Hacs

Hi,
in the ultimate release after update hacs continuos It proposes the same upgrade.
Many thanks

KingArt KING-M4 compability

Hi, thanks for very nice work,

i have an wall dimmer switch in eweelink app, that does not appear in HA, any chance there is a way to intergrate it?

KingArt, model KING-M4, firmware: 2.7.0 (PSF-BTA-GL)

Refresh interval

Maxx, thank you very much for your custom component. It works very well for me. How can I set the refresh time of the attributes as power or current of my POWR2?

Only work right after restart

I got a switch using ewelink not sonoff.

It work switch on/off right after home assistant reboot. After that it would throw
WARNING (MainThread) [custom_components.sonoff] Can't send switches to 1000xxxxxx

It works again after about 15 / 30 mins .... then stop again after switching.

Beside, the device only have 1 gang but it shows 4 in home assistant.

If i switch via ewelink app, home assistant shows correct stat.

No Devices listed in the UI

Just installed the package with HACS, got a .sonoff.json file with 74kb of data in it, but nothing shows up as devices in the UI of the Home Assistant.
Got a mix of Sonoff devices, EU wall switches, 4 Channel, 4 Channel Pro, etc.

Can turn device off but not on

I have an sonoff mini and i can turn it off via HA develepors tools via states. the sonoff mini will switch off the light but the switch in HA states will just jump back to on. if i click fast enough so before te switch goes back automaticly i can turn on the light.

Как подключить больше одного устройства Sonoff mini?

Здравствуйте! Подключил по вашему методу устройство Sonoff mini. Встроил его в настольную лампу. Все работает отлично. Можно ли подключить больше одного устройства? Перепробовал много вариантов:
sonoff:
- devices:
1000a44d9a:
apikey: !secret sonoff_mini_1_apikey
channels: 1
- devices:
1000a561bf:
apikey: !secret sonoff_mini_2_apikey
channels: 2
И так:
sonoff:
devices:
- 1000a44d9a:
apikey: !secret sonoff_mini_1_apikey
channels: 1
- 1000a561bf:
apikey: !secret sonoff_mini_2_apikey
channels: 2
Всё равно не работает. Помогите.

Light turn ON randomly

Hi! Thanks for your great work!!1

I have one Sonoff D1 dimmer integrated in my Home assistant with your integration. It works great. The only issue is that the light turn ON ramdomly. Below my configuration :

sonoff:
devices:
1000d0451d:
devivekey: !secret sonoff_devicekey

Is there something I missed?

Thanks!!!!

Sonoff POW template configuration

Hi Alex! Could you please post Sonoff POW template-sensor configuration, similar to the temp-humidity sample? I tried to modify the one for the TH sensor, but it doesn't work.
pow_nas_power: friendly_name: Sonoff POW NAS Power device_class: power value_template: "{{ state_attr('switch.sonoff_10000bb678', 'power') }}" pow_multim_power: friendly_name: Sonoff POW MM Power entity_id: switch.sonoff_100012f43f value_template: "{{ state_attr('switch.sonoff_100012f43f', 'power') }}"

Power consumption Sonoff S26

Hello. I have tested Sonoff S26. Working great.

I want to ask if it's possible to read power consumption? Do not have any extra options in attributes.

Thanks!

Support WiFi Smart Circuit Breaker and Sonoff Hum

some outputs:

[ { "__v": 0, "_id": "[hidden]", "apikey": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "brandLogoUrl": "", "brandName": "ITEAD", "createdAt": "xxxx-xx-xxxxx:xx:xx.xxx", "deviceStatus": "", "deviceUrl": "", "deviceid": "[hidden]", "devicekey": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "extra": { "_id": "[hidden]", "extra": { "apmac": "xx:xx:xx:xx:xx:xx", "brandId": "55e00a982ed643527f31425d", "description": "", "mac": "xx:xx:xx:xx:xx:xx", "manufacturer": "\u6df1\u5733\u521b\u6613\u667a\u80fd\u7cfb\u7edf\u6709\u9650\u516c\u53f8", "model": "PSA-BTA-GL", "modelInfo": "57e4e659ae0f76857b1603ae", "ui": "\u4e09\u6863\u52a0\u6e7f\u5668", "uiid": 19 } }, "group": "", "groups": [], "ip": "[hidden]", "location": "", "name": "[hidden]", "offlineTime": "xxxx-xx-xxxxx:xx:xx.xxx", "online": false, "onlineTime": "xxxx-xx-xxxxx:xx:xx.xxx", "params": { "fwVersion": "2.0.2", "mode": "normal", "password": "", "rssi": -60, "ssid": "", "staMac": "xx:xx:xx:xx:xx:xx", "state": 0, "switch": "off", "water": 1 }, "productModel": "Sonoff Hum", "settings": { "alarmNotify": 1, "opsHistory": 1, "opsNotify": 0 }, "sharedTo": [], "showBrand": true, "type": "10", "uiid": 19 }, { "__v": 0, "_id": "[hidden]", "apikey": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "brandLogoUrl": "", "brandName": "WDYK", "createdAt": "xxxx-xx-xxxxx:xx:xx.xxx", "deviceUrl": "", "deviceid": "[hidden]", "devicekey": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "extra": { "_id": "[hidden]", "extra": { "apmac": "xx:xx:xx:xx:xx:xx", "brandId": "5b97ab4db4f633024aa10e4f", "chipid": "00C1F9C5", "description": "20181226006", "mac": "xx:xx:xx:xx:xx:xx", "manufacturer": "\u6d59\u6c5f\u601d\u521b\u7535\u529b\u79d1\u6280\u80a1\u4efd\u6709\u9650\u516c\u53f8", "model": "PSF-B01-GL", "modelInfo": "5b99ce654854868a31c35364", "staMac": "xx:xx:xx:xx:xx:xx", "ui": "\u5355\u901a\u9053\u5f00\u5173", "uiid": 6 } }, "group": "", "groups": [], "ip": "[hidden]", "location": "", "name": "[hidden]", "offlineTime": "xxxx-xx-xxxxx:xx:xx.xxx", "online": true, "onlineTime": "xxxx-xx-xxxxx:xx:xx.xxx", "params": { "fwVersion": "3.0.0", "init": 1, "pulse": "off", "pulseWidth": 500, "rssi": -55, "sledOnline": "on", "staMac": "xx:xx:xx:xx:xx:xx", "startup": "stay", "switch": "on", "version": 8 }, "productModel": "ZJSB9-80", "settings": { "alarmNotify": 1, "opsHistory": 1, "opsNotify": 0 }, "sharedTo": [], "showBrand": true, "type": "10", "uiid": 6 } ]

more outputs for hum:

`//////////////////////////////
water shortage, switch off
//////////////////////////////
{
"__v": 0,
"_id": "[hidden]",
"apikey": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"brandLogoUrl": "",
"brandName": "ITEAD",
"createdAt": "xxxx-xx-xxxxx:xx:xx.xxx",
"deviceStatus": "",
"deviceUrl": "",
"deviceid": "[hidden]",
"devicekey": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"extra": {
"_id": "[hidden]",
"extra": {
"apmac": "xx:xx:xx:xx:xx:xx",
"brandId": "55e00a982ed643527f31425d",
"description": "",
"mac": "xx:xx:xx:xx:xx:xx",
"manufacturer": "\u6df1\u5733\u521b\u6613\u667a\u80fd\u7cfb\u7edf\u6709\u9650\u516c\u53f8",
"model": "PSA-BTA-GL",
"modelInfo": "57e4e659ae0f76857b1603ae",
"staMac": "xx:xx:xx:xx:xx:xx",
"ui": "\u4e09\u6863\u52a0\u6e7f\u5668",
"uiid": 19
}
},
"group": "",
"groups": [],
"ip": "[hidden]",
"location": "",
"name": "[hidden]",,
"offlineTime": "xxxx-xx-xxxxx:xx:xx.xxx",
"online": true,
"onlineTime": "xxxx-xx-xxxxx:xx:xx.xxx",
"params": {
"fwVersion": "2.7.0",
"mode": "normal",
"password": "",
"rssi": -47,
"sledOnline": "on",
"ssid": "",
"staMac": "xx:xx:xx:xx:xx:xx",
"state": 3,
"switch": "off",
"timers": [],
"water": 0
},
"productModel": "Sonoff Hum",
"settings": {
"alarmNotify": 1,
"opsHistory": 1,
"opsNotify": 0
},
"sharedTo": [],
"showBrand": true,
"type": "10",
"uiid": 19
}

//////////////////////////////
water shortage, switch on, position 1
//////////////////////////////
{
"__v": 0,
"_id": "[hidden]",
"apikey": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"brandLogoUrl": "",
"brandName": "ITEAD",
"createdAt": "xxxx-xx-xxxxx:xx:xx.xxx",
"deviceStatus": "",
"deviceUrl": "",
"deviceid": "[hidden]",
"devicekey": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"extra": {
"_id": "[hidden]",
"extra": {
"apmac": "xx:xx:xx:xx:xx:xx",
"brandId": "55e00a982ed643527f31425d",
"description": "",
"mac": "xx:xx:xx:xx:xx:xx",
"manufacturer": "\u6df1\u5733\u521b\u6613\u667a\u80fd\u7cfb\u7edf\u6709\ u9650\u516c\u53f8",
"model": "PSA-BTA-GL",
"modelInfo": "57e4e659ae0f76857b1603ae",
"staMac": "xx:xx:xx:xx:xx:xx",
"ui": "\u4e09\u6863\u52a0\u6e7f\u5668",
"uiid": 19
}
},
"group": "",
"groups": [],
"ip": "[hidden]",
"location": "",
"name": "[hidden]",,
"offlineTime": "xxxx-xx-xxxxx:xx:xx.xxx",
"online": true,
"onlineTime": "xxxx-xx-xxxxx:xx:xx.xxx",
"params": {
"fwVersion": "2.7.0",
"mode": "normal",
"password": "",
"rssi": -47,
"sledOnline": "on",
"ssid": "",
"staMac": "xx:xx:xx:xx:xx:xx",
"state": 1,
"switch": "on",
"timers": [],
"water": 0
},
"productModel": "Sonoff Hum",
"settings": {
"alarmNotify": 1,
"opsHistory": 1,
"opsNotify": 0
},
"sharedTo": [],
"showBrand": true,
"type": "10",
"uiid": 19
}

//////////////////////////////
water shortage, switch on, position 2
//////////////////////////////
{
"__v": 0,
"_id": "[hidden]",
"apikey": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"brandLogoUrl": "",
"brandName": "ITEAD",
"createdAt": "xxxx-xx-xxxxx:xx:xx.xxx",
"deviceStatus": "",
"deviceUrl": "",
"deviceid": "[hidden]",
"devicekey": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"extra": {
"_id": "[hidden]",
"extra": {
"apmac": "xx:xx:xx:xx:xx:xx",
"brandId": "55e00a982ed643527f31425d",
"description": "",
"mac": "xx:xx:xx:xx:xx:xx",
"manufacturer": "\u6df1\u5733\u521b\u6613\u667a\u80fd\u7cfb\u7edf\u6709\u9650\u516c\u53f8",
"model": "PSA-BTA-GL",
"modelInfo": "57e4e659ae0f76857b1603ae",
"staMac": "xx:xx:xx:xx:xx:xx",
"ui": "\u4e09\u6863\u52a0\u6e7f\u5668",
"uiid": 19
}
},
"group": "",
"groups": [],
"ip": "[hidden]",
"location": "",
"name": "[hidden]",,
"offlineTime": "xxxx-xx-xxxxx:xx:xx.xxx",
"online": true,
"onlineTime": "xxxx-xx-xxxxx:xx:xx.xxx",
"params": {
"fwVersion": "2.7.0",
"mode": "normal",
"password": "",
"rssi": -47,
"sledOnline": "on",
"ssid": "",
"staMac": "xx:xx:xx:xx:xx:xx",
"state": 2,
"switch": "on",
"timers": [],
"water": 0
},
"productModel": "Sonoff Hum",
"settings": {
"alarmNotify": 1,
"opsHistory": 1,
"opsNotify": 0
},
"sharedTo": [],
"showBrand": true,
"type": "10",
"uiid": 19
}

//////////////////////////////
water shortage, switch on, position 3
//////////////////////////////

{
"__v": 0,
"_id": "[hidden]",
"apikey": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"brandLogoUrl": "",
"brandName": "ITEAD",
"createdAt": "xxxx-xx-xxxxx:xx:xx.xxx",
"deviceStatus": "",
"deviceUrl": "",
"deviceid": "[hidden]",
"devicekey": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"extra": {
"_id": "[hidden]",
"extra": {
"apmac": "xx:xx:xx:xx:xx:xx",
"brandId": "55e00a982ed643527f31425d",
"description": "",
"mac": "xx:xx:xx:xx:xx:xx",
"manufacturer": "\u6df1\u5733\u521b\u6613\u667a\u80fd\u7cfb\u7edf\u6709\u9650\u516c\u53f8",
"model": "PSA-BTA-GL",
"modelInfo": "57e4e659ae0f76857b1603ae",
"staMac": "xx:xx:xx:xx:xx:xx",
"ui": "\u4e09\u6863\u52a0\u6e7f\u5668",
"uiid": 19
}
},
"group": "",
"groups": [],
"ip": "[hidden]",
"location": "",
"name": "[hidden]",,
"offlineTime": "xxxx-xx-xxxxx:xx:xx.xxx",
"online": true,
"onlineTime": "xxxx-xx-xxxxx:xx:xx.xxx",
"params": {
"fwVersion": "2.7.0",
"mode": "normal",
"password": "",
"rssi": -47,
"sledOnline": "on",
"ssid": "",
"staMac": "xx:xx:xx:xx:xx:xx",
"state": 3,
"switch": "on",
"timers": [],
"water": 0
},
"productModel": "Sonoff Hum",
"settings": {
"alarmNotify": 1,
"opsHistory": 1,
"opsNotify": 0
},
"sharedTo": [],
"showBrand": true,
"type": "10",
"uiid": 19
}

//////////////////////////////
water normal, switch off
//////////////////////////////
{
"__v": 0,
"_id": "[hidden]",
"apikey": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"brandLogoUrl": "",
"brandName": "ITEAD",
"createdAt": "xxxx-xx-xxxxx:xx:xx.xxx",
"deviceStatus": "",
"deviceUrl": "",
"deviceid": "[hidden]",
"devicekey": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"extra": {
"_id": "[hidden]",
"extra": {
"apmac": "xx:xx:xx:xx:xx:xx",
"brandId": "55e00a982ed643527f31425d",
"description": "",
"mac": "xx:xx:xx:xx:xx:xx",
"manufacturer": "\u6df1\u5733\u521b\u6613\u667a\u80fd\u7cfb\u7edf\u6709\u9650\u516c\u53f8",
"model": "PSA-BTA-GL",
"modelInfo": "57e4e659ae0f76857b1603ae",
"staMac": "xx:xx:xx:xx:xx:xx",
"ui": "\u4e09\u6863\u52a0\u6e7f\u5668",
"uiid": 19
}
},
"group": "",
"groups": [],
"ip": "[hidden]",
"location": "",
"name": "[hidden]",,
"offlineTime": "xxxx-xx-xxxxx:xx:xx.xxx",
"online": true,
"onlineTime": "xxxx-xx-xxxxx:xx:xx.xxx",
"params": {
"fwVersion": "2.7.0",
"mode": "normal",
"password": "",
"rssi": -47,
"sledOnline": "on",
"ssid": "",
"staMac": "xx:xx:xx:xx:xx:xx",
"state": 3,
"switch": "off",
"timers": [],
"water": 1
},
"productModel": "Sonoff Hum",
"settings": {
"alarmNotify": 1,
"opsHistory": 1,
"opsNotify": 0
},
"sharedTo": [],
"showBrand": true,
"type": "10",
"uiid": 19
}

//////////////////////////////
water normal, switch on, position 1
//////////////////////////////
{
"__v": 0,
"_id": "[hidden]",
"apikey": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"brandLogoUrl": "",
"brandName": "ITEAD",
"createdAt": "xxxx-xx-xxxxx:xx:xx.xxx",
"deviceStatus": "",
"deviceUrl": "",
"deviceid": "[hidden]",
"devicekey": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"extra": {
"_id": "[hidden]",
"extra": {
"apmac": "xx:xx:xx:xx:xx:xx",
"brandId": "55e00a982ed643527f31425d",
"description": "",
"mac": "xx:xx:xx:xx:xx:xx",
"manufacturer": "\u6df1\u5733\u521b\u6613\u667a\u80fd\u7cfb\u7edf\u6709\u9650\u516c\u53f8",
"model": "PSA-BTA-GL",
"modelInfo": "57e4e659ae0f76857b1603ae",
"staMac": "xx:xx:xx:xx:xx:xx",
"ui": "\u4e09\u6863\u52a0\u6e7f\u5668",
"uiid": 19
}
},
"group": "",
"groups": [],
"ip": "[hidden]",
"location": "",
"name": "[hidden]",,
"offlineTime": "xxxx-xx-xxxxx:xx:xx.xxx",
"online": true,
"onlineTime": "xxxx-xx-xxxxx:xx:xx.xxx",
"params": {
"fwVersion": "2.7.0",
"mode": "normal",
"password": "",
"rssi": -47,
"sledOnline": "on",
"ssid": "",
"staMac": "xx:xx:xx:xx:xx:xx",
"state": 1,
"switch": "on",
"timers": [],
"water": 1
},
"productModel": "Sonoff Hum",
"settings": {
"alarmNotify": 1,
"opsHistory": 1,
"opsNotify": 0
},
"sharedTo": [],
"showBrand": true,
"type": "10",
"uiid": 19
}

//////////////////////////////
water normal, switch on, position 2
//////////////////////////////
{
"__v": 0,
"_id": "[hidden]",
"apikey": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"brandLogoUrl": "",
"brandName": "ITEAD",
"createdAt": "xxxx-xx-xxxxx:xx:xx.xxx",
"deviceStatus": "",
"deviceUrl": "",
"deviceid": "[hidden]",
"devicekey": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"extra": {
"_id": "[hidden]",
"extra": {
"apmac": "xx:xx:xx:xx:xx:xx",
"brandId": "55e00a982ed643527f31425d",
"description": "",
"mac": "xx:xx:xx:xx:xx:xx",
"manufacturer": "\u6df1\u5733\u521b\u6613\u667a\u80fd\u7cfb\u7edf\u6709\u9650\u516c\u53f8",
"model": "PSA-BTA-GL",
"modelInfo": "57e4e659ae0f76857b1603ae",
"staMac": "xx:xx:xx:xx:xx:xx",
"ui": "\u4e09\u6863\u52a0\u6e7f\u5668",
"uiid": 19
}
},
"group": "",
"groups": [],
"ip": "[hidden]",
"location": "",
"name": "[hidden]",,
"offlineTime": "xxxx-xx-xxxxx:xx:xx.xxx",
"online": true,
"onlineTime": "xxxx-xx-xxxxx:xx:xx.xxx",
"params": {
"fwVersion": "2.7.0",
"mode": "normal",
"password": "",
"rssi": -47,
"sledOnline": "on",
"ssid": "",
"staMac": "xx:xx:xx:xx:xx:xx",
"state": 2,
"switch": "on",
"timers": [],
"water": 1
},
"productModel": "Sonoff Hum",
"settings": {
"alarmNotify": 1,
"opsHistory": 1,
"opsNotify": 0
},
"sharedTo": [],
"showBrand": true,
"type": "10",
"uiid": 19
}

//////////////////////////////
water normal, switch on, position 3
//////////////////////////////
{
"__v": 0,
"_id": "[hidden]",
"apikey": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"brandLogoUrl": "",
"brandName": "ITEAD",
"createdAt": "xxxx-xx-xxxxx:xx:xx.xxx",
"deviceStatus": "",
"deviceUrl": "",
"deviceid": "[hidden]",
"devicekey": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"extra": {
"_id": "[hidden]",
"extra": {
"apmac": "xx:xx:xx:xx:xx:xx",
"brandId": "55e00a982ed643527f31425d",
"description": "",
"mac": "xx:xx:xx:xx:xx:xx",
"manufacturer": "\u6df1\u5733\u521b\u6613\u667a\u80fd\u7cfb\u7edf\u6709\u9650\u516c\u53f8",
"model": "PSA-BTA-GL",
"modelInfo": "57e4e659ae0f76857b1603ae",
"staMac": "xx:xx:xx:xx:xx:xx",
"ui": "\u4e09\u6863\u52a0\u6e7f\u5668",
"uiid": 19
}
},
"group": "",
"groups": [],
"ip": "[hidden]",
"location": "",
"name": "[hidden]",,
"offlineTime": "xxxx-xx-xxxxx:xx:xx.xxx",
"online": true,
"onlineTime": "xxxx-xx-xxxxx:xx:xx.xxx",
"params": {
"fwVersion": "2.7.0",
"mode": "normal",
"password": "",
"rssi": -47,
"sledOnline": "on",
"ssid": "",
"staMac": "xx:xx:xx:xx:xx:xx",
"state": 3,
"switch": "on",
"timers": [],
"water": 1
},
"productModel": "Sonoff Hum",
"settings": {
"alarmNotify": 1,
"opsHistory": 1,
"opsNotify": 0
},
"sharedTo": [],
"showBrand": true,
"type": "10",
"uiid": 19
}`

circuit breaker link:
https://www.aliexpress.com/item/3P-WiFi-Smart-Circuit-Breaker-Automatic-Switch-overload-short-circuit-protection-for-Amazon-Alexa-and-Google/32954500280.html?spm=a2g0s.9042311.0.0.27424c4d2e8iCD

Support Sonoff L1 LED Strip

It would be awesome with Sonoff LED strip. I'm sorted by most requested functions.

  • On/Off
  • Change color
  • Brightness
  • Mode
    • Coloful
    • Sync to music
    • Coloful Gradient
    • ...

Support firmware 2.7 and 2.6.1

Hi everyone!

The current version supports only firmware 3.
Firmware 2 has completely different API!

In my free time I plan to add work with cloud servers to support 2nd firmware.

You can currently use this component @peterbuga, it works with cloud servers and support firmware 2 and 3.

Known devices on the 2nd firmware version:

  • Sonoff POW (first) v2.6.1
  • Sonoff L1 (LED strip) v2.7.0
  • Sonoff Hum (humidifier) v2.7.0
  • King Art - King Q4 Cover v2.7.0
  • Sonoff SC (sensor)

Install two sonoff component

Hey Alexx

Sorry for my newbie question,I have a problem with the installation the folder sonoff already exist from a previous custom component . I want to install yours without deleting the other one . For testing and migrating slowly without losing some automatons and so on is there anyway I can do that ?

Thank you

Current number kW consumed in the day

Hi AlexxIT

I have shown numbers V, A and W
I want to display the number kW consumed in the day, how will I do?
For example: Today - 124kW

Thank you

ảnh

Devices available in NodeRed?

Noob question, sorry if I'm getting mixed up...
Installation on Raspberry Pi was fine (I think).
Should I be able to see the Sonoff devices in my Node Red installation?

upgrade to 0.106.2

upgrading to 0.106.2 config checker shows...
General Errors:
- Component error: sonoff - No module named 'zeroconf'

Sonoff TH firmware 3.4.0 don't work!!!

После обновления прошивки на sonoff th10 получаю такую ошибку:
WARNING (MainThread) [custom_components.sonoff] Error when send switch to 10008ce99f

Add friendly names for children buttons and sensors

Hi
I can see the sonoff bridge in HA and have added this with correct id to the configuration.yaml file, but I does not get any alarms from the door sensors in HA. Should this work with DW1 sensor?
automation:

  • alias: Test RF
    trigger:
    platform: event
    event_type: sonoff.remote
    event_data:
    command: 0
    action:
    service: homeassistant.toggle
    entity_id: remote.sonoff_1000abcdefg

Sonoff S26 Support

Hai Allex.

Thanks for your work on this integration. It is so awesome for the newbies that did not have any background on programming and knowledge on PCB modification or hacking.

This integration gives me a great relived due to no heavy programming and modification but I found that there is no Sonoff S26 device supported on the detail description or guide.

It is very helpful that you can provide the additional S26 device into the supported list.

Best regard.

Bridge Sonoff 443 receive signal from RF

Alex, can I receive RF information through a Sonoff bridge? In the integration example just send. You can tell me if it can be received and how is the code. As always, thank you very much for your time.

I get this error and it doesn't work for me

2020-01-21 22:29:05 ERROR (MainThread) [homeassistant.setup] Error during setup of component sonoff
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/setup.py", line 174, in _async_setup_component
component.setup, hass, processed_config # type: ignore
File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/sonoff/init.py", line 35, in setup
config[CONF_PASSWORD])
File "/config/custom_components/sonoff/utils.py", line 63, in load_devices
headers = {'Authorization': "Bearer " + resp['at']}
KeyError: 'at'

Cannot login with my phone

My eWeLink user name is not a email. It is phone number with country code.
I'm trying to set my phone number to username field in configuration. But don't work.

Light Symbol

Hi,

First of all, I would like to tell you how amazing this plugin is and how it has saved me hours.

I have one question. in the image below you can see the master bedroom lamps symbol is a lightning bolt. is there a way to change it to a light bulb?

If you could help i would really appreciate it.

Kind Regards

Adam

image

status not updated

I have sonoff s26 connected by SonoffLAN and working fine when I restarted my Hass, and my sonoff was off. After my Hass up the status in dashboard was on even the status of my sonoff was off!
how to make the status sync with current status after restart?

Sonoff RF Bridge 433

Hi Allex, thank you for working on the integration it is awesome. I not getting the RF Bridge 433 . I have 3 RF plugs and they are in the ewelink app. I can see the ( sonoff.remote ) in home assistant. am I be able to make a on and off switch for them in home assistant or a door sensor.

Switch keeps the same state

Hi.
I'm trying to use with my email and password, without any work on private keys, etc.
I'm using a Sonoff Micro USB.

So far it's working, but the state of the switch keeps on even if the real switch is off.
Eg:
The switch is ON on HA, i press it to go OFF, the real switch goes OFF but after 1 second the switch on HA becomes ON again, but the real switch stays OFF.
If i want to make the real switch ON again i have to press twice on HA (1 to go OFF and 1 to go ON again) and the real switch goes ON.

What could be the issue?

Support King Art - King Q4 Cover

Hi, first, thanks for your work on this.
Do your component have compatibility with the Kingart king-q4 blinds controller?
I'm using peterbuga's component but althoug I can open and close the blinds, it is not possible to have control of the percentage.
Thanks!

Can't send switch to

Hello,

I can see the state of the devices, but when I'm trying to switch on/off any I'm getting this:

2020-02-14 07:01:54 DEBUG (SyncWorker_13) [custom_components.sonoff] Send switch to 3030a05abf: {'sequence': '1581660114', 'deviceid': '3030a05abf', 'selfApikey': '123', 'data': '2UA9Ie507+HgJVuOfCc2tLQa/x3DBnxzgnidsb9e1eo=', 'encrypt': True, 'iv': 'XvZFLmaIc2scA3ULzhKp2Q=='}
2020-02-14 07:01:57 WARNING (SyncWorker_13) [custom_components.sonoff] Can't send switch to 3030a05abf

(I've changed the Id's/data/iv)

Sonoff Mini State not changing in HA

I've installed SonoffLan and connected a Sonoff Mini to Home Assistant, however the state can't be changed in HA either in developer or in Lovelace Entity card. I can however change the state when I control using Node red, so the addon is communication to the device, Is this a know issue, I can't see anything in the issues log?

Статус sonoff mini после перезагрузки НА

После перезагрузки НА статус sonoff mini не отображается, вернее "неизвестно" пока не попингуешь устройство или не передернешь выключатель.
SonOff Mini в DIY MODE
Это как то можно вылечить ?

Work on two routers

it pulled my ewelink info into the sonoff.Jason file but when I go to
Current entities in Developer Tools no sonoffs are there.
any other place to look or other settings ?
I even tried putting one in with the ID and switch in the config but nothing.
could this be because all 12 of my ewelink sonoffs are on different wifi router and SSID .
my HA HassIO new fresh install but its connected with Ethernet to my main DLS modem?router. and all my ewelink devises are on a separate router that is connected to the DSL moden/router.
not sure why this would matter because my shellys using factory setting MQTT show up and they are on the same SSID as the ewelink sonoffs.
HassOS 3.10 Home Assistant 0.105.3
raspberry pi 4

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.