I am trying to import a Tasmotized sonoff basic r2 into Homeassistant (HA) via ESPHome. Using the ESPHome function built into HA.
I am using Migrating from Sonoff Tasmota — ESPHome I am not using Hassio and have tried to guess how to do it in my HA running in a Virtual box on a Win 10 PC using this: Home Assistant on Windows using VirtualBox GUIDE - YouTube
The device, livingroom light, appears in the HA ESPHome display:
livingroomlight
Filename: livingroomlight.yaml
EDIT VALIDATE UPLOAD LOGS
I used the sample configuration provided here: Using With Sonoff Basic — ESPHome
livingroomlight.yaml
esphome:
name: livingroomlight
platform: ESP8266
board: esp01_1m
wifi:
ssid: “XXXX”
password: “XXXXXXXXXX”
api:
logger:
ota:
binary_sensor:
- platform: gpio
pin:
number: GPIO0
mode: INPUT_PULLUP
inverted: True
name: “Sonoff Basic Button”
on_press:- switch.toggle: relay
switch:
- platform: gpio
name: “Sonoff Basic Relay”
pin: GPIO12
id: relay
status_led:
pin:
number: GPIO13
After executing Validation, the following errors were reported:
Logger: homeassistant.setup
Source: util/async_.py:139
First occurred: 10:23:12 AM (1 occurrences)
Last logged: 10:23:12 AM
Error during setup of component sonoff
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/setup.py”, line 242, in _async_setup_component
result = await task
File “/config/custom_components/sonoff/init.py”, line 53, in async_setup
hass.data[DOMAIN] = Sonoff(hass, config)
File “/config/custom_components/sonoff/init.py”, line 100, in init
self.do_login()
File “/config/custom_components/sonoff/init.py”, line 175, in do_login
r = requests.post(‘https://{}-api.coolkit.cc:8080/api/user/login’.format(self._api_region),
File “/usr/local/lib/python3.8/site-packages/requests/api.py”, line 119, in post
return request(‘post’, url, data=data, json=json, **kwargs)
File “/usr/local/lib/python3.8/site-packages/requests/api.py”, line 61, in request
return session.request(method=method, url=url, **kwargs)
File “/usr/local/lib/python3.8/site-packages/requests/sessions.py”, line 542, in request
resp = self.send(prep, **send_kwargs)
File “/usr/local/lib/python3.8/site-packages/requests/sessions.py”, line 655, in send
r = adapter.send(request, **kwargs)
File “/usr/local/lib/python3.8/site-packages/requests/adapters.py”, line 439, in send
resp = conn.urlopen(
File “/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py”, line 699, in urlopen
httplib_response = self._make_request(
File “/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py”, line 394, in _make_request
conn.request(method, url, **httplib_request_kw)
File “/usr/local/lib/python3.8/site-packages/urllib3/connection.py”, line 234, in request
super(HTTPConnection, self).request(method, url, body=body, headers=headers)
File “/usr/local/lib/python3.8/http/client.py”, line 1255, in request
self._send_request(method, url, body, headers, encode_chunked)
File “/usr/local/lib/python3.8/http/client.py”, line 1266, in send_request
self.putrequest(method, url, **skips)
File “/usr/local/lib/python3.8/site-packages/urllib3/connection.py”, line 214, in putrequest
return HTTPConnection.putrequest(self, method, url, *args, **kwargs)
File "/usr/src/homeassistant/homeassistant/util/async.py", line 150, in protected_loop_func
check_loop()
File "/usr/src/homeassistant/homeassistant/util/async.py", line 139, in check_loop
raise RuntimeError(
RuntimeError: I/O must be done in the executor; Use await hass.async_add_executor_job()
at custom_components/sonoff/init.py, line 175: r = requests.post(‘https://{}-api.coolkit.cc:8080/api/user/login’.format(self._api_region),
Log Details (WARNING)
Logger: homeassistant.util.async_
Source: util/async_.py:131
First occurred: 10:23:12 AM (1 occurrences)
Last logged: 10:23:12 AM
Detected I/O inside the event loop. This is causing stability issues. Please report issue to the custom component author for sonoff doing I/O at custom_components/sonoff/init.py, line 175: r = requests.post(‘https://{}-api.coolkit.cc:8080/api/user/login’.format(self._api_region),
At this point I am not sure what needs revision. The following additional is provided. Please advise what I need to correct.
The Tasmota data for the device follows:
Sonoff Basic Module
livingroomlight
Program Version 9.3.1(tasmota)
Build Date & Time 2021-03-09T16:12:28
Core/SDK Version 2_7_4_9/2.2.2-dev(38a443e)
Uptime 0T00:25:00
Flash write Count 58 at 0xFA000
Boot Count 15
Restart Reason Power On
Friendly Name 1 Living Room Light
AP1 SSId (RSSI) ASUS (66%, -67 dBm)
Hostname tasmota_0DF888-6280
MAC Address C4:DD:57:0D:F8:88
IP Address (wifi) 192.168.1.11
Gateway 192.168.1.1
Subnet Mask 255.255.255.0
DNS Server 192.168.1.1
MQTT Host
MQTT Port 1883
MQTT User DVES_USER
MQTT Client DVES_0DF888
MQTT Topic tasmota_%06X
MQTT Group Topic 1 cmnd/tasmotas/
MQTT Full Topic cmnd/tasmota_0DF888/
MQTT Fallback Topic cmnd/DVES_0DF888_fb/
MQTT No Retain Disabled
Emulation Belkin WeMo
ESP Chip Id 915592
Flash Chip Id 0x144051
Flash Size 1024 kB
Program Flash Size 1024 kB
Program Size 593 kB
Free Program Space 408 kB
Free Memory 27.0 kB
Configuration files
Configuration.yaml
Configure a default setup of Home Assistant (frontend, api, etc)
default_config:
Text to speech
tts:
- platform: google_translate
group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
homeassistant:
auth_providers:- type: homeassistant
SonOFF Devices
sonoff:
username: XXXXXXXXXXXXXXX
password: XXXXXXXXXX
scan_interval: 60
grace_period: 600
api_region: ‘us’
entity_prefix: True #(optional)
debug: False #(optional)
Livingroomlight.yaml
esphome:
name: livingroomlight
platform: ESP8266
board: esp01_1m
wifi:
ssid: “XXXX”
password: “XXXXXXXXXX”
Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: “Livingroomlight Fallback Hotspot”
password: “DRoKmyZlUqw8”
captive_portal:
Enable logging
logger:
Enable Home Assistant API
api:
password: “XXXXXXXXXX”
ota:
password: “XXXXXXXXXX”
HA Install info
Home Assistant 2021.4.6
Path to configuration.yaml: /config
System Health
Version core-2021.4.6
Installation Type Home Assistant OS
Development false
Supervisor true
Docker true
Virtual Environment false
Python Version 3.8.7
Operating System Family Linux
Operating System Version 5.4.109
CPU Architecture x86_64
Timezone America/Chicago
Home Assistant Cloud
MANAGE
Logged In false
Reach Certificate Server ok
Reach Authentication Server ok
Reach Home Assistant Cloud ok
Home Assistant Supervisor
MANAGE
Host Operating System Home Assistant OS 5.13
Update Channel stable
Supervisor Version supervisor-2021.04.0
Docker Version 19.03.15
Disk Total 97.7 GB
Disk Used 3.8 GB
Healthy true
Supported true
Board ova
Supervisor API ok
Version API ok
Installed Add-ons Mosquitto broker (5.1.1), File editor (5.2.0), ESPHome (1.16.2), TasmoAdmin (0.14.1), Duck DNS (1.12.5), Samba share (9.3.1)
Lovelace
MANAGE
Dashboards 1
Resources 0
Mode auto-gen