Quantcast
Channel: ESPHome - Home Assistant Community
Viewing all 1486 articles
Browse latest View live

Ultrasonic Sensor Time Out

$
0
0

@carltonb wrote:

I am using a an HC-SR04 sensor with a nodemcu.
My code is

  - platform: ultrasonic
    trigger_pin: D1
    echo_pin: D2
    name: "Salt Sensor"
    pulse_time: 20us
    timeout: 2.0m
    update_interval: 5s
    filters:
      - filter_out: nan

I keep getting a distance timeout error. This was discussed in github back in March and May with people having similar problems. Tried the fix but the code would not validate.

Here is my log.

[12:38:40][C][logger:175]: Logger:
[12:38:40][C][logger:176]:   Level: DEBUG
[12:38:40][C][logger:177]:   Log Baud Rate: 115200
[12:38:40][C][logger:178]:   Hardware UART: UART0
[12:38:40][C][ultrasonic.sensor:034]: Ultrasonic Sensor 'Salt Sensor'
[12:38:40][C][ultrasonic.sensor:034]:   Unit of Measurement: 'm'
[12:38:40][C][ultrasonic.sensor:034]:   Accuracy Decimals: 2
[12:38:40][C][ultrasonic.sensor:034]:   Icon: 'mdi:arrow-expand-vertical'
[12:38:40][C][ultrasonic.sensor:035]:   Echo Pin: GPIO15 (Mode: INPUT)
[12:38:40][C][ultrasonic.sensor:036]:   Trigger Pin: GPIO12 (Mode: OUTPUT)
[12:38:40][C][ultrasonic.sensor:037]:   Pulse time: 20 µs
[12:38:40][C][ultrasonic.sensor:038]:   Timeout: 11661 µs
[12:38:40][C][ultrasonic.sensor:039]:   Update Interval: 5.0s
[12:38:40][C][captive_portal:169]: Captive Portal:
[12:38:40][C][ota:029]: Over-The-Air Updates:
[12:38:40][C][ota:030]:   Address: salt_level.local:8266
[12:38:40][C][api:095]: API Server:
[12:38:40][C][api:096]:   Address: salt_level.local:6053
[12:38:44][D][ultrasonic.sensor:025]: 'Salt Sensor' - Distance measurement timed out!
[12:38:49][D][ultrasonic.sensor:025]: 'Salt Sensor' - Distance measurement timed out!
[12:38:54][D][ultrasonic.sensor:025]: 'Salt Sensor' - Distance measurement timed out!

Can someone tell me what I might need to fix.
Thank you.
carltonb

Posts: 1

Participants: 1

Read full topic


Bug or error in my config? Disconnect after switching Smartplug (Gosund SP112)

$
0
0

@JamesT42 wrote:

Hello!
I have a strange problem. My smartplug disconnects from the HA api every time I switch it. It is a Gosund SP112, this is my config. Some parts connected to the power measurement are commented out because otherwise the serial debug does not work. But the problem is independent of that.

substitutions:
  plug_name: esp_smartplug2
  plug_fullname: "Smartplug #2"
  comment: "Smartplug SP112 with USB ports and power measurement"
  # Variables for the power measurement
  # Lower value gives lower voltage readout
  voltage_factor: "1.89"

esphome:
  name: ${plug_name}
  platform: ESP8266
  board: esp8285
  # Save states in flash so that power outage does not cause total chaos afterwards, be careful: limited flash memory write cycles
  #esp8266_restore_from_flash: true

wifi:
  ssid: !secret wifissid
  password: !secret wifipassword
  # To change the address, set this to the old address, delete the #, flash, then put the # back and flash again
  #use_address: oldaddress.local
  ap:
    ssid: "$plug_name Fallback Hotspot"
    password: !secret otapassword

# Enable captive portal
captive_portal:

# Enable logging
logger:
  level: VERY_VERBOSE   #DEBUG is the default

# Enable Home Assistant API
api:
  password: !secret apipassword

# Enable OTA flashing
ota:
  safe_mode: True
  password: !secret otapassword

#Webserver
web_server:
  port: 80

# UART for the power sensor
#uart:
#  rx_pin: RX
#  baud_rate: 4800

# Send the firmware version to HA
text_sensor:
  - platform: version
    name: "$plug_fullname Firmware Version"

# Status LED, is inverted so it is normally of, blinks when error
status_led:
  pin:
    number: GPIO0
    inverted: True

# Send time to the plug, not used right now but could be useful for timed on/off
time:
  - platform: homeassistant
    id: my_time

binary_sensor:
  # Button changes virtual fakebutton state
  - platform: gpio
    id: button
    pin:
      number: GPIO16
      inverted: True
    on_multi_click:
    - timing:
      - ON for at most 1s
      - OFF for at most 1s
      - ON for at most 1s
      - OFF for at least 0.2s
      then:
        - logger.log: "Double Clicked"
        - switch.toggle: fakebuttonUSB
    - timing:
      - ON for 1s to 2s
      - OFF for at least 0.5s
      then:
        - logger.log: "Single Long Clicked"
        - switch.toggle: fakebutton
        - switch.toggle: fakebuttonUSB
    - timing:
      - ON for at most 1s
      - OFF for at least 0.5s
      then:
        - logger.log: "Single Short Clicked"
        - switch.toggle: fakebutton
  # Send status to HA
  - platform: status
    name: "$plug_fullname Status"

switch:
  # Virtual buttons
  - platform: template
    name: "$plug_fullname State"
    optimistic: true
    id: fakebutton
    turn_on_action:
    - switch.turn_on: relay
    - light.turn_on: led
    turn_off_action:
    - switch.turn_off: relay
    - light.turn_off: led
    restore_state: true
  - platform: template
    name: "$plug_fullname USB"
    optimistic: true
    id: fakebuttonUSB
    turn_on_action:
    - switch.turn_on: relayUSB
    - light.turn_on: led
    turn_off_action:
    - switch.turn_off: relayUSB
    - light.turn_off: led
    restore_state: true
  # Relays
  - platform: gpio
    id: relay
    pin: GPIO14
    restore_mode: RESTORE_DEFAULT_OFF
  - platform: gpio
    id: relayUSB
    pin: GPIO5
    restore_mode: RESTORE_DEFAULT_ON

output:
  # Blue LED to show relay on/off states
  - platform: esp8266_pwm
    id: pow_blue_led
    pin:
      number: GPIO2
      inverted: True

light:
  # Virtual light state
  - platform: monochromatic
    output: pow_blue_led
    id: led
    restore_mode: RESTORE_DEFAULT_OFF

sensor:
  #Send wifi signal strength
  - platform: wifi_signal
    name: "$plug_fullname WiFi Signal"
    update_interval: 60s
  # Send uptime
  - platform: uptime
    name: "$plug_fullname Uptime"
  # Power monitoring chip
#  - platform: cse7766
#    current:
#      name: "$plug_fullname Current"
#      unit_of_measurement: A
#    voltage:
#      name: "$plug_fullname Voltage"
#      unit_of_measurement: V
#      filters:
#        - multiply: $voltage_factor
#    power:
#      name: "$plug_fullname Power"
#      unit_of_measurement: W
#      id: power
#    update_interval: 5s
  # Total daily energy usage calculation
#  - platform: total_daily_energy
#    name: "$plug_fullname Total Daily Energy"
#    power_id: power
#    filters:
        # Multiplication factor from W to kW is 0.001
#        - multiply: 0.001
#    unit_of_measurement: kWh

This is the debug log:


INFO Reading configuration /config/esphome/esp_smartplug2.yaml...
INFO Detected timezone 'CET' with UTC offset 1 and daylight savings time from 29 March 02:00:00 to 25 October 03:00:00
INFO Starting log output from /dev/ttyUSB0 with baud rate 115200
[21:57:27]0
[21:57:27]ld
[21:57:27]
[21:57:27]SDK:2.2.1(cfd48f3)/Core:2.5.2=20502000/lwIP:STABLE-2_1_2_RELEASE/glue:1.1-7-g82abda3/BearSSL:a143020
[21:57:27][I][logger:156]: Log initialized
[21:57:27][C][status_led:014]: Setting up Status LED...
[21:57:27][VV][preferences:038]: LOAD 32: valid=YES, 0=0x00000000 1=0x0DEFE4E3 (Type=233825507, CRC=0x0DEFE4E3)
[21:57:27][C][ota:364]: There have been 0 suspected unsuccessful boot attempts.
[21:57:27][VV][preferences:051]: SAVE 32: 0=0x00000001 1=0x42F4583F (Type=233825507, CRC=0x42F4583F)
[21:57:27][I][app:028]: Running through setup()...
[21:57:27][V][app:029]: Sorting components by setup priority...
[21:57:27][D][binary_sensor:034]: 'button': Sending initial state OFF
[21:57:27][VV][preferences:038]: LOAD 0: valid=YES, 0=0x00000000 1=0xCF427395 (Type=3477238677, CRC=0xCF427395)
[21:57:27][D][template.switch:050]:   Restored state OFF
[21:57:27][D][switch:025]: 'Smartplug #2 State' Turning OFF.
[21:57:27][D][switch:025]: 'relay' Turning OFF.
[21:57:27][D][switch:045]: 'relay': Sending state OFF
[21:57:27][D][light:264]: 'led' Setting:
[21:57:27][D][light:303]:   Transition Length: 1.0s
[21:57:27][VV][preferences:051]: SAVE 0: 0=0x00000000 1=0xCF427395 (Type=3477238677, CRC=0xCF427395)
[21:57:27][D][switch:045]: 'Smartplug #2 State': Sending state OFF
[21:57:27][VV][preferences:038]: LOAD 2: valid=NO, 0=0xFFFFFFFF 1=0xFFFFFFFF (Type=685782952, CRC=0x1804748B)
[21:57:27][C][switch.gpio:011]: Setting up GPIO Switch 'relay'...
[21:57:27][VV][preferences:038]: LOAD 4: valid=YES, 0=0x00000000 1=0xD3A92FE4 (Type=3551080420, CRC=0xD3A92FE4)
[21:57:27][D][switch:025]: 'relay' Turning OFF.
[21:57:27][D][switch:025]: 'relay' Turning OFF.
[21:57:27][C][switch.gpio:011]: Setting up GPIO Switch 'relayUSB'...
[21:57:27][VV][preferences:038]: LOAD 6: valid=YES, 0=0x00000001 1=0x470CCFC6 (Type=135754522, CRC=0x470CCFC6)
[21:57:27][D][switch:021]: 'relayUSB' Turning ON.
[21:57:27][VV][preferences:051]: SAVE 6: 0=0x00000001 1=0x470CCFC6 (Type=135754522, CRC=0x470CCFC6)
[21:57:27][D][switch:045]: 'relayUSB': Sending state ON
[21:57:27][D][switch:021]: 'relayUSB' Turning ON.
[21:57:27][C][esp8266_pwm:017]: Setting up ESP8266 PWM Output...
[21:57:27][VV][scheduler:056]: set_interval(name='update', interval=60000, offset=20094)
[21:57:27][C][light:097]: Setting up light 'led'...
[21:57:27][VV][preferences:038]: LOAD 8: valid=YES, 0=0x00000000 1=0x3F800000 (Type=646037088, CRC=0x2681BE60)
[21:57:27][D][light:264]: 'led' Setting:
[21:57:27][D][light:277]:   Brightness: 100%
[21:57:27][VV][preferences:051]: SAVE 8: 0=0x00000000 1=0x3F800000 (Type=646037088, CRC=0x2681BE60)
[21:57:27][D][binary_sensor:034]: 'Smartplug #2 Status': Sending initial state OFF
[21:57:27][D][text_sensor:015]: 'Smartplug #2 Firmware Version': Sending state '1.14.3 Jan  8 2020, 21:55:17'
[21:57:27][VV][scheduler:056]: set_interval(name='', interval=900000, offset=390586)
[21:57:27][VV][preferences:038]: LOAD 17: valid=NO, 0=0x00000000 1=0xA0BC17C1 (Type=2051358253, CRC=0x696E4CB2)
[21:57:27][C][wifi:033]: Setting up WiFi...
[21:57:27][V][wifi_esp8266:043]: Disabling AP.
[21:57:27]bcn 0
[21:57:27]del if1
[21:57:27]usl
[21:57:27]mode : null
[21:57:27][V][wifi_esp8266:033]: Enabling STA.
[21:57:27]mode : sta(dc:4f:22:9c:b0:81)
[21:57:27]add if0
[21:57:27][V][wifi_esp8266:376]: Event: Changed Mode old=AP new=OFF
[21:57:27]wifi evt: 8
[21:57:27][V][wifi_esp8266:376]: Event: Changed Mode old=OFF new=STA
[21:57:27]wifi evt: 8
[21:57:27]sleep disable
[21:57:27][D][wifi:304]: Starting scan...
[21:57:27][VV][scheduler:131]: Running interval '' with interval=900000 last_execution=4293690714 (now=14060)
[21:57:27][VV][scheduler:131]: Running interval 'update' with interval=60000 last_execution=4294901148 (now=14060)
[21:57:27][V][sensor:013]: 'Smartplug #2 Uptime': Received new state 14.076000
[21:57:27][D][sensor:092]: 'Smartplug #2 Uptime': Sending state 14.07600 s with 0 decimals of accuracy
[21:57:33]scandone
[21:57:33][D][wifi:319]: Found networks:
[21:57:33][I][wifi:365]: - 'MyWIFI' 

[redacted]▂▄▆█
[21:57:33][D][wifi:366]:     Channel: 11
[21:57:33][D][wifi:367]:     RSSI: -47 dB
[21:57:33][I][wifi:365]: - 'MyWIFI' 

[redacted]▂▄▆█

[21:57:33][I][wifi:193]: WiFi Connecting to 'MyWIFI'...
[21:57:33][V][wifi:195]: Connection Params:
[21:57:33][V][wifi:196]:   SSID: 'MyWIFI'
[21:57:33][V][wifi:199]:   BSSID: 04:F0:21:23:31:0F
[21:57:33][V][wifi:203]:   Password: 

[redacted]
[21:57:33][V][wifi:205]:   Channel: 11
[21:57:33][V][wifi:215]:   Using DHCP IP
[21:57:33][V][wifi:217]:   Hidden: NO
[21:57:33][V][wifi_esp8266:344]: Event: Changed AuthMode old=OPEN new=WPA2 PSK
[21:57:33]wifi evt: 2
[21:57:34]scandone
[21:57:35]state: 0 -> 2 (b0)
[21:57:35]state: 2 -> 3 (0)
[21:57:35]state: 3 -> 5 (10)
[21:57:35]add 0
[21:57:35]aid 10
[21:57:35]cnt 
[21:57:35]
[21:57:35]connected with MyWIFI, channel 11
[21:57:35]dhcp client start...
[21:57:35][V][wifi_esp8266:325]: Event: Connected ssid='MyWIFI' bssid=04:F0:21:23:31:0F channel=11
[21:57:35]wifi evt: 0
[21:57:35]ip:192.168.0.249,mask:255.255.255.0,gw:192.168.0.1
[21:57:35][V][wifi_esp8266:350]: Event: Got IP static_ip=192.168.0.249 gateway=192.168.0.1 netmask=255.255.255.0
[21:57:35]wifi evt: 3
[21:57:35][I][wifi:423]: WiFi Connected!
[21:57:35][C][wifi:283]:   SSID: 

[redacted]
[21:57:35][C][wifi:284]:   IP Address: 192.168.0.249
[21:57:35][C][wifi:286]:   BSSID: 

[redacted]
[21:57:35][C][wifi:287]:   Hostname: 'esp_smartplug2'
[21:57:35][C][wifi:291]:   Signal strength: -56 dB ▂▄▆█
[21:57:35][V][wifi:293]:   Priority: 0.0
[21:57:35][C][wifi:295]:   Channel: 11
[21:57:35][C][wifi:296]:   Subnet: 255.255.255.0
[21:57:35][C][wifi:297]:   Gateway: 192.168.0.1
[21:57:35][C][wifi:298]:   DNS1: 192.168.0.1
[21:57:35][C][wifi:299]:   DNS2: (IP unset)
[21:57:35][D][wifi:432]: Disabling AP...
[21:57:35][C][web_server:066]: Setting up web server...
[21:57:35][VV][scheduler:056]: set_interval(name='', interval=10000, offset=4454)
[21:57:35][C][ota:029]: Over-The-Air Updates:
[21:57:35][C][ota:030]:   Address: esp_smartplug2.local:8266
[21:57:35][C][ota:032]:   Using Password.
[21:57:35][C][api:022]: Setting up Home Assistant API server...
[21:57:35][VV][scheduler:056]: set_interval(name='update', interval=60000, offset=29199)
[21:57:35][I][app:058]: setup() finished successfully!
[21:57:35][VV][scheduler:131]: Running interval 'update' with interval=60000 last_execution=4294899885 (now=21794)
[21:57:35][V][sensor:013]: 'Smartplug #2 WiFi Signal': Received new state -56.000000
[21:57:35][D][sensor:092]: 'Smartplug #2 WiFi Signal': Sending state -56.00000 dB with 0 decimals of accuracy
[21:57:35][VV][scheduler:131]: Running interval '' with interval=10000 last_execution=7305 (now=21794)
[21:57:35][I][app:100]: ESPHome version 1.14.3 compiled on Jan  8 2020, 21:55:17
[21:57:35][C][status_led:019]: Status LED:
[21:57:35][C][status_led:020]:   Pin: GPIO0 (Mode: OUTPUT, INVERTED)
[21:57:35][C][wifi:415]: WiFi:
[21:57:35][C][wifi:283]:   SSID: 

[redacted]
[21:57:35][C][wifi:284]:   IP Address: 192.168.0.249
[21:57:35][C][wifi:286]:   BSSID: 

[redacted]
[21:57:35][C][wifi:287]:   Hostname: 'esp_smartplug2'
[21:57:35][C][wifi:291]:   Signal strength: -56 dB ▂▄▆█
[21:57:35][V][wifi:293]:   Priority: 0.0
[21:57:35][C][wifi:295]:   Channel: 11
[21:57:35][C][wifi:296]:   Subnet: 255.255.255.0
[21:57:35][C][wifi:297]:   Gateway: 192.168.0.1
[21:57:35][C][wifi:298]:   DNS1: 192.168.0.1
[21:57:35][C][wifi:299]:   DNS2: (IP unset)
[21:57:35][C][gpio.binary_sensor:015]: GPIO Binary Sensor 'button'
[21:57:35][C][gpio.binary_sensor:016]:   Pin: GPIO16 (Mode: INPUT, INVERTED)
[21:57:35][C][template.switch:058]: Template Switch 'Smartplug #2 State'
[21:57:35][C][template.switch:059]:   Restore State: YES
[21:57:35][C][template.switch:060]:   Optimistic: YES
[21:57:35][C][template.switch:058]: Template Switch 'Smartplug #2 USB'
[21:57:35][C][template.switch:059]:   Restore State: YES
[21:57:35][C][template.switch:060]:   Optimistic: YES
[21:57:35][C][switch.gpio:042]: GPIO Switch 'relay'
[21:57:35][C][switch.gpio:043]:   Pin: GPIO14 (Mode: OUTPUT)
[21:57:35][C][switch.gpio:059]:   Restore Mode: Restore (Defaults to OFF)
[21:57:35][C][switch.gpio:042]: GPIO Switch 'relayUSB'
[21:57:35][C][switch.gpio:043]:   Pin: GPIO5 (Mode: OUTPUT)
[21:57:35][C][switch.gpio:059]:   Restore Mode: Restore (Defaults to ON)
[21:57:35][C][esp8266_pwm:022]: ESP8266 PWM:
[21:57:35][C][esp8266_pwm:023]:   Pin: GPIO2 (Mode: OUTPUT, INVERTED)
[21:57:35][C][esp8266_pwm:024]:   Frequency: 1000.0 Hz
[21:57:35][C][uptime.sensor:030]: Uptime Sensor 'Smartplug #2 Uptime'
[21:57:35][C][uptime.sensor:030]:   Unit of Measurement: 's'
[21:57:35][C][uptime.sensor:030]:   Accuracy Decimals: 0
[21:57:35][C][uptime.sensor:030]:   Icon: 'mdi:timer'
[21:57:35][V][uptime.sensor:030]:   Unique ID: 'dc4f229cb081-uptime'
[21:57:35][C][logger:175]: Logger:
[21:57:35][C][logger:176]:   Level: VERY_VERBOSE
[21:57:35][C][logger:177]:   Log Baud Rate: 115200
[21:57:35][C][logger:178]:   Hardware UART: UART0
[21:57:35][C][light:177]: Light 'led'
[21:57:35][C][light:179]:   Default Transition Length: 1.0s
[21:57:35][C][light:180]:   Gamma Correct: 2.80
[21:57:35][C][status:034]: Status Binary Sensor 'Smartplug #2 Status'
[21:57:35][C][status:034]:   Device Class: 'connectivity'
[21:57:35][C][version.text_sensor:015]: Version Text Sensor 'Smartplug #2 Firmware Version'
[21:57:35][C][version.text_sensor:015]:   Icon: 'mdi:new-box'
[21:57:35][V][version.text_sensor:015]:   Unique ID: 'dc4f229cb081-version'
[21:57:35][C][homeassistant.time:010]: Home Assistant Time:
[21:57:35][C][homeassistant.time:011]:   Timezone: 'CET-1CEST-2,M3.5.0/2,M10.4.0/3'
[21:57:35][C][captive_portal:169]: Captive Portal:
[21:57:35][C][web_server:122]: Web Server:
[21:57:35][C][web_server:123]:   Address: esp_smartplug2.local:80
[21:57:35][C][ota:029]: Over-The-Air Updates:
[21:57:35][C][ota:030]:   Address: esp_smartplug2.local:8266
[21:57:35][C][ota:032]:   Using Password.
[21:57:35][C][api:095]: API Server:
[21:57:35][C][api:096]:   Address: esp_smartplug2.local:6053
[21:57:35][C][wifi_signal.sensor:009]: WiFi Signal 'Smartplug #2 WiFi Signal'
[21:57:35][C][wifi_signal.sensor:009]:   Unit of Measurement: 'dB'
[21:57:35][C][wifi_signal.sensor:009]:   Accuracy Decimals: 0
[21:57:36][C][wifi_signal.sensor:009]:   Icon: 'mdi:wifi'
[21:57:36][V][wifi_signal.sensor:009]:   Unique ID: 'dc4f229cb081-wifisignal'
[21:57:40][VV][scheduler:131]: Running interval '' with interval=10000 last_execution=17305 (now=27310)
[21:57:45]pm open,type:0 0
[21:57:50][D][binary_sensor:036]: 'Smartplug #2 Status': Sending state ON
[21:57:50][VV][api.service:222]: on_hello_request: HelloRequest {
[21:57:50]  client_info: 'Home Assistant 0.103.5'
[21:57:50]}
[21:57:50][V][api.connection:567]: Hello from client: 'Home Assistant 0.103.5 (192.168.0.33)'
[21:57:50][VV][api.service:010]: send_hello_response: HelloResponse {
[21:57:50]  api_version_major: 1
[21:57:50]  api_version_minor: 3
[21:57:50]  server_info: 'esp_smartplug2 (esphome v1.14.3)'
[21:57:50]}
[21:57:50][VV][api.service:229]: on_connect_request: ConnectRequest {
[21:57:50]  password: 'redacted'
[21:57:50]}
[21:57:50][D][api.connection:583]: Client 'Home Assistant 0.103.5 (192.168.0.33)' connected successfully!
[21:57:50][VV][api.service:171]: send_get_time_request: GetTimeRequest {}
[21:57:50][VV][api.service:015]: send_connect_response: ConnectResponse {
[21:57:50]  invalid_password: NO
[21:57:50]}
[21:57:50][VV][api.service:342]: on_get_time_response: GetTimeResponse {
[21:57:50]  epoch_seconds: 1578517070
[21:57:50]}
[21:57:50][D][time:029]: Synchronized time: Wed Jan  8 21:57:50 2020
[21:57:50][VV][api.service:264]: on_device_info_request: DeviceInfoRequest {}
[21:57:50][VV][api.service:040]: send_device_info_response: DeviceInfoResponse {
[21:57:50]  uses_password: YES
[21:57:50]  name: 'esp_smartplug2'
[21:57:50]  mac_address: 'DC:4F:22:9C:B0:81'
[21:57:50]  esphome_version: '1.14.3'
[21:57:50]  compilation_time: 'Jan  8 2020, 21:55:17'
[21:57:50]  model: 'PLATFORMIO_ESP8285'
[21:57:50]  has_deep_sleep: NO
[21:57:50]}
[21:57:50][VV][api.service:271]: on_list_entities_request: ListEntitiesRequest {}
[21:57:50][VV][api.service:051]: send_list_entities_binary_sensor_response: ListEntitiesBinarySensorResponse {
[21:57:50]  object_id: 'smartplug_2_status'
[21:57:50]  key: 3399211564
[21:57:50]  name: 'Smartplug #2 Status'
[21:57:50]  unique_id: 'esp_smartplug2binary_sensorsmartplug_2_status'
[21:57:50]  device_class: 'connectivity'
[21:57:50]  is_status_binary_sensor: YES
[21:57:50]}
[21:57:50][VV][api.service:113]: send_list_entities_sensor_response: ListEntitiesSensorResponse {
[21:57:50]  object_id: 'smartplug_2_wifi_signal'
[21:57:50]  key: 3552917572
[21:57:50]  name: 'Smartplug #2 WiFi Signal'
[21:57:50]  unique_id: 'dc4f229cb081-wifisignal'
[21:57:50]  icon: 'mdi:wifi'
[21:57:50]  unit_of_measurement: 'dB'
[21:57:50]  accuracy_decimals: 0
[21:57:50]  force_update: NO
[21:57:50]}
[21:57:50][VV][api.service:113]: send_list_entities_sensor_response: ListEntitiesSensorResponse {
[21:57:50]  object_id: 'smartplug_2_uptime'
[21:57:50]  key: 80662530
[21:57:50]  name: 'Smartplug #2 Uptime'
[21:57:50]  unique_id: 'dc4f229cb081-uptime'
[21:57:50]  icon: 'mdi:timer'
[21:57:50]  unit_of_measurement: 's'
[21:57:50]  accuracy_decimals: 0
[21:57:50]  force_update: NO
[21:57:50]}
[21:57:50][VV][scheduler:131]: Running interval '' with interval=10000 last_execution=27305 (now=37364)
[21:57:50][VV][api.service:127]: send_list_entities_switch_response: ListEntitiesSwitchResponse {
[21:57:50]  object_id: 'smartplug_2_state'
[21:57:50]  key: 3477238677
[21:57:50]  name: 'Smartplug #2 State'
[21:57:50]  unique_id: 'esp_smartplug2switchsmartplug_2_state'
[21:57:50]  icon: ''
[21:57:50]  assumed_state: NO
[21:57:50]}
[21:57:50][VV][api.service:127]: send_list_entities_switch_response: ListEntitiesSwitchResponse {
[21:57:50]  object_id: 'smartplug_2_usb'
[21:57:50]  key: 685782952
[21:57:50]  name: 'Smartplug #2 USB'
[21:57:50]  unique_id: 'esp_smartplug2switchsmartplug_2_usb'
[21:57:50]  icon: ''
[21:57:50]  assumed_state: NO
[21:57:50]}
[21:57:51][VV][api.service:143]: send_list_entities_text_sensor_response: ListEntitiesTextSensorResponse {
[21:57:51]  object_id: 'smartplug_2_firmware_version'
[21:57:51]  key: 2344351488
[21:57:51]  name: 'Smartplug #2 Firmware Version'
[21:57:51]  unique_id: 'dc4f229cb081-version'
[21:57:51]  icon: 'mdi:new-box'
[21:57:51]}
[21:57:51][VV][api.service:045]: send_list_entities_done_response: ListEntitiesDoneResponse {}
[21:57:51][VV][api.service:278]: on_subscribe_states_request: SubscribeStatesRequest {}
[21:57:51][VV][api.service:328]: on_subscribe_homeassistant_services_request: SubscribeHomeassistantServicesRequest {}
[21:57:51][VV][api.service:349]: on_subscribe_home_assistant_states_request: SubscribeHomeAssistantStatesRequest {}
[21:57:51][VV][api.service:058]: send_binary_sensor_state_response: BinarySensorStateResponse {
[21:57:51]  key: 3399211564
[21:57:51]  state: YES
[21:57:51]  missing_state: NO
[21:57:51]}
[21:57:51][VV][api.service:120]: send_sensor_state_response: SensorStateResponse {
[21:57:51]  key: 3552917572
[21:57:51]  state: -56
[21:57:51]  missing_state: NO
[21:57:51]}
[21:57:51][VV][api.service:120]: send_sensor_state_response: SensorStateResponse {
[21:57:51]  key: 80662530
[21:57:51]  state: 14.076
[21:57:51]  missing_state: NO
[21:57:51]}
[21:57:51][VV][api.service:134]: send_switch_state_response: SwitchStateResponse {
[21:57:51]  key: 3477238677
[21:57:51]  state: NO
[21:57:51]}
[21:57:51][VV][api.service:134]: send_switch_state_response: SwitchStateResponse {
[21:57:51]  key: 685782952
[21:57:51]  state: NO
[21:57:51]}
[21:57:51][VV][api.service:150]: send_text_sensor_state_response: TextSensorStateResponse {
[21:57:51]  key: 2344351488
[21:57:51]  state: '1.14.3 Jan  8 2020, 21:55:17'
[21:57:51]  missing_state: NO
[21:57:51]}
[21:58:00][VV][scheduler:131]: Running interval '' with interval=10000 last_execution=37305 (now=47305)
[21:58:05][VV][api.service:250]: on_ping_request: PingRequest {}
[21:58:05][VV][api.service:035]: send_ping_response: PingResponse {}
[21:58:06][VV][scheduler:131]: Running interval 'update' with interval=60000 last_execution=4294959885 (now=52590)
[21:58:06][V][sensor:013]: 'Smartplug #2 WiFi Signal': Received new state -56.000000
[21:58:06][D][sensor:092]: 'Smartplug #2 WiFi Signal': Sending state -56.00000 dB with 0 decimals of accuracy
[21:58:06][VV][api.service:120]: send_sensor_state_response: SensorStateResponse {
[21:58:06]  key: 3552917572
[21:58:06]  state: -56
[21:58:06]  missing_state: NO
[21:58:06]}
[21:58:07][VV][scheduler:131]: Running interval 'update' with interval=60000 last_execution=4294961148 (now=53858)
[21:58:07][V][sensor:013]: 'Smartplug #2 Uptime': Received new state 53.862000
[21:58:07][D][sensor:092]: 'Smartplug #2 Uptime': Sending state 53.86200 s with 0 decimals of accuracy
[21:58:07][VV][api.service:120]: send_sensor_state_response: SensorStateResponse {
[21:58:07]  key: 80662530
[21:58:07]  state: 53.862
[21:58:07]  missing_state: NO
[21:58:07]}
[21:58:10][VV][scheduler:131]: Running interval '' with interval=10000 last_execution=47305 (now=57305)
[21:58:14][VV][api.service:320]: on_switch_command_request: SwitchCommandRequest {
[21:58:14]  key: 3477238677
[21:58:14]  state: YES
[21:58:14]}
[21:58:14][D][switch:021]: 'Smartplug #2 State' Turning ON.
[21:58:14][D][switch:021]: 'relay' Turning ON.
[21:58:14][VV][preferences:107]: Saving preferences to flash...
[21:58:19][VV][preferences:051]: SAVE 4: 0=0x00000001 1=0x9CB29338 (Type=3551080420, CRC=0x9CB29338)
[21:58:19][D][switch:045]: 'relay': Sending state ON
[21:58:19][D][light:264]: 'led' Setting:
[21:58:19][D][light:273]:   State: ON
[21:58:19][D][light:303]:   Transition Length: 1.0s
[21:58:20][VV][preferences:107]: Saving preferences to flash...
[21:58:25][VV][preferences:051]: SAVE 8: 0=0x00000001 1=0x3F800000 (Type=646037088, CRC=0x699A02BC)
[21:58:25][VV][preferences:107]: Saving preferences to flash...
[21:58:30][VV][preferences:051]: SAVE 0: 0=0x00000001 1=0x8059CF49 (Type=3477238677, CRC=0x8059CF49)
[21:58:30][D][switch:045]: 'Smartplug #2 State': Sending state ON
[21:58:30][VV][api.service:134]: send_switch_state_response: SwitchStateResponse {
[21:58:30]  key: 3477238677
[21:58:30]  state: YES
[21:58:30]}
[21:58:30][V][app:076]: A component took a long time in a loop() cycle (16.39 s).
[21:58:30][V][app:077]: Components should block for at most 20-30ms in loop().
[21:58:30][VV][scheduler:131]: Running interval '' with interval=10000 last_execution=57305 (now=77352)
[21:58:30][D][api:067]: Disconnecting Home Assistant 0.103.5 (192.168.0.33)
[21:58:30][D][binary_sensor:036]: 'Smartplug #2 Status': Sending state OFF
[21:58:40][D][binary_sensor:036]: 'Smartplug #2 Status': Sending state ON
[21:58:40][VV][api.service:222]: on_hello_request: HelloRequest {
[21:58:40]  client_info: 'Home Assistant 0.103.5'
[21:58:40]}
[21:58:40][V][api.connection:567]: Hello from client: 'Home Assistant 0.103.5 (192.168.0.33)'
[21:58:40][VV][api.service:010]: send_hello_response: HelloResponse {
etc. etc.

Look at this for example, while this happesn HA looses the api connection.

[21:58:30][V][app:076]: A component took a long time in a loop() cycle (16.39 s).
[21:58:30][V][app:077]: Components should block for at most 20-30ms in loop().

Why does this happen? I’m extremely sure that this worked with the exact config a few versions and weeks ago.

Thank you for your great work otherwise! Cheers, James

Posts: 1

Participants: 1

Read full topic

Analog PH Sensor -> Arduino Uno -> ESP8266 (Wemos D1 Mini) -> ESPhome -> Home Assistant

$
0
0

@frasskungin wrote:

I have project for a microbrewery, where the aim is to be able to monitor pH during a certain step of the process, and trigger notifications when certain pH thresholds are met. I’ve managed to source a cheap Analog 5V pH-sensor, which is hooked up to an Arduino and converts the voltage to a pH value. I’m also connecting the Arduino to an LCD-screen, so you can see the current pH-value locally.

My intention is now send that Arduino pH value to ESPhome. The ultimate goal is to have a sensor in Home Assistant, which displays the same value shown in the LCD. I’ve tried to work my way through understanding the Custom UART component in ESPhome, but I’m not sure where I go wrong. I’ve connected the Arduino and Wemos using the RX and TX pins (RX -> TX and TX->RX). This is the sketch for the Arduino:

#include <Wire.h> 
#include <LiquidCrystal_I2C.h>

const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2;
//LiquidCrystal lcd(rs, en, d4, d5, d6, d7);
LiquidCrystal_I2C lcd(0x3F, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);  // Set the LCD I2C address
float calibration = 21.42; //change this value to calibrate
const int analogInPin = A0; 
int sensorValue = 0; 
unsigned long int avgValue; 
float b;
int buf[10],temp;
void setup() {
 lcd.begin(16, 2);
 Serial.begin(9600);
}
 
void loop() {
 for(int i=0;i<10;i++) 
 { 
 buf[i]=analogRead(analogInPin);
 delay(30);
 }
 for(int i=0;i<9;i++)
 {
 for(int j=i+1;j<10;j++)
 {
 if(buf[i]>buf[j])
 {
 temp=buf[i];
 buf[i]=buf[j];
 buf[j]=temp;
 }
 }
   }
 avgValue=0;
 for(int i=2;i<8;i++)
 avgValue+=buf[i];
 float pHVol=(float)avgValue*5.0/1024/6;
 float phValue = -5.70 * pHVol + calibration;
 Serial.println(phValue);
 lcd.print("pH: ");
 lcd.print(phValue);
 lcd.setCursor(0,1);
 if (phValue < 4) {
  lcd.print("Very acidic");
 }
 else if (phValue >= 4 && phValue < 5) {
  lcd.print("Acidic");
 }
 else if (phValue >= 5 && phValue < 7) {
  lcd.print("Acidic-ish");
 }
 else if (phValue >= 7 && phValue < 8) {
  lcd.print("Neutral");
 }
 else if (phValue >= 8 && phValue < 10) {
  lcd.print("Alkaline-ish");
 }
 else if (phValue >= 10 && phValue < 11) {
  lcd.print("Alkaline");
 }
 else if (phValue >= 11) {
  lcd.print("Very alkaline");
 }
 delay(3000);
 lcd.clear();
 
}

So my question is; Do I need to add something in the Arduino code and what configurations do I need to do on the ESP side to read that pHValue as a sensor value for Home Assistant?

Posts: 3

Participants: 3

Read full topic

ESPHome: binary_sensor GPIO => keep status for x time

$
0
0

@prankousky wrote:

Hi everybody,

is there a way to “safe” the current binary_sensor status on ESPHome for a set period of time? I am using an RCWL-0516 radar sensor, and it seems to constantly change between on and off. The relevant parts of my code are

switch:
      number: D1
      inverted: yes
    name: Gelb
    id: gelb

binary_sensor:
  - platform: gpio
    pin: D0
    name: "Radar"
    device_class: motion
    filters:
      - invert
    on_press:
      then:
        - switch.turn_on: gelb
    on_release:
      then: 
        - switch.turn_off: gelb

radar

As you can see here, it keeps toggling within seconds; those periods of time where it doesn’t toggle right away, I have been re-flashing the ESPHome

I have found delayed_on_off (and delayed_on / delayed_off), however, those seem to only toggle the sensor, if it has been set to a certain state for a set period of time; I, however, would like the sensor to turn on as soon as it detects motion; but I also want it to stay on after detecting motion for, for example, one minute before toggling back to off. Can this be achieved?

Thank you for your ideas :slight_smile:

Posts: 1

Participants: 1

Read full topic

ESPHome USB upload fails

$
0
0

@helgemor wrote:

In ESPHome 1.14.3 and 1.15-dev I’m unable to upload via a USB port. What’s happened, or what am I doing wrong?
The upload terminates with the message below (this is in 1.14.3).
I’ve tried “chmod a+rw /dev/ttyUSB1” in the esphome docker and outside.
I’ve tried connecting my ESP32 to a CP2102 usb interface, both 3.3v and 5v, both ground pins.
I don’t know what else to try. (OTA upload works fine, so it’s something with the usb)

Serial port /dev/ttyUSB1
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/serial/serialposix.py", line 265, in open
    self.fd = os.open(self.portstr, os.O_RDWR | os.O_NOCTTY | os.O_NONBLOCK)
OSError: [Errno 5] Input/output error: '/dev/ttyUSB1'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/root/.platformio/packages/tool-esptoolpy/esptool.py", line 2959, in <module>
    _main()
  File "/root/.platformio/packages/tool-esptoolpy/esptool.py", line 2952, in _main
    main()
  File "/root/.platformio/packages/tool-esptoolpy/esptool.py", line 2652, in main
    esp = chip_class(each_port, initial_baud, args.trace)
  File "/root/.platformio/packages/tool-esptoolpy/esptool.py", line 222, in init
    self._port = serial.serial_for_url(port)
  File "/usr/local/lib/python3.6/dist-packages/serial/init.py", line 88, in serial_for_url
    instance.open()
  File "/usr/local/lib/python3.6/dist-packages/serial/serialposix.py", line 268, in open
    raise SerialException(msg.errno, "could not open port {}: {}".format(self._port, msg))
serial.serialutil.SerialException: [Errno 5] could not open port /dev/ttyUSB1: [Errno 5] Input/output error: '/dev/ttyUSB1'
*** [upload] Error 1

Posts: 4

Participants: 2

Read full topic

Tuya Dimmer and datapoint of switch and dimm

$
0
0

@fra290 wrote:

As mentioned on the documentation i have put in yamal file:

# Uart definition to talk to MCU dimmer
uart:
  tx_pin: GPIO1
  rx_pin: GPIO3
  stop_bits: 1
  baud_rate: 9600

# Register the Tuya MCU connection
tuya:

but I’m not abale to find the Datapoint of switch and dimm… this is the log:

[17:32:22][C][uart:145]: UART Bus:
[17:32:22][C][uart:147]:   TX Pin: GPIO1
[17:32:22][C][uart:150]:   RX Pin: GPIO3
[17:32:22][C][uart:152]:   Baud Rate: 9600 baud
[17:32:22][C][uart:153]:   Stop bits: 1
[17:32:22][C][uart:155]:   Using hardware serial interface.
[17:32:22](Message skipped because it was too big to fit in TCP buffer - This is only cosmetic)
[17:32:22][C][tuya:024]: Tuya:
[17:32:22](Message skipped because it was too big to fit in TCP buffer - This is only cosmetic)
[17:34:09][I][ota:046]: Boot seems successful, resetting boot loop counter.

does anyone have any suggestions to give me? the hardware is that:
image
TNK

Posts: 1

Participants: 1

Read full topic

Shelly 2.5 OTA flash somehow?

$
0
0

@michel72 wrote:

I found that the Shelly has an OTA upgrade script for the original firmware:

http://192.168.x.x/ota?url=http://repo.shelly.cloud/firmware/test/SHSW-21_build.zip

I downloaded the firmware: http://repo.shelly.cloud/firmware/test/SHSW-21_build.zip
and it contains a binary as well as a manifest file. They seem to use some sort of a checksum/hash to check if the firmware is original.

Can we not fake this somehow? The shelly 2.5 has extremely small pinheaders that make it really hard to flash esphome.

Posts: 1

Participants: 1

Read full topic

Any way to make multiline YAML substitutions?

$
0
0

@ab0tj wrote:

Lately I’ve been keeping my ESPHome configs separated into a generic device file (in this example, a certain model of smart plug) and a file with substitutions specific to the item I’ll be installing it on. This works great for things like the name, but I’m stuck on trying to use this for something like the linear_calibration values where there are multiple lines in the substitution.

I have been trying to use the | symbol as the YAML standard specifies, which almost works but I get various errors. For example, this is the closest I’ve gotten to a working config:

(in the generic yaml)

    power:
      name: ${device_name} Power
      id: power
      filters:
      - delta: 0.01
      - calibrate_linear:
        - ${power_calibration}

(in the item-specfic yaml)

power_calibration: |
    0.0 -> 0.0
  - 1.0 -> 1.2

This generates errors when trying to compile:

while parsing a block mapping
  in "/config/esphome/coffee_maker_plug.yaml", line 2, column 3:
      id_name: coffee_maker_plug
      ^
expected <block end>, but found '-'
  in "/config/esphome/coffee_maker_plug.yaml", line 7, column 3:
      - 1.0 -> 2.0
      ^

Posts: 2

Participants: 1

Read full topic


Has someone esp32 ESPHome on FreeBSD?

$
0
0

@CyanoFresh wrote:

Hello. Cannot compile firmware for esp32 on FreeBSD due to missing toolchain-xtensa32.
Maybe someone managed it to work?

Posts: 1

Participants: 1

Read full topic

If it works with Tasmota, will it work with ESPHome?

$
0
0

@belgian_style wrote:

I have 4 of these devices: https://templates.blakadder.com/treatlife_SS01S.html. I was originally going to flash them with tasmota but after reading up on ESPHome, I think I want to go that route instead. If they are compatible with tasmota firmware via a template, does that mean its compatible with ESPHome? I cracked open the case to see if I could research anything on the chip but this area of tech is new to me and I’m getting a bit lost. How can I tell what Platform and board type to use in my configs? Appreciate someone pointing me in the right direction!

Posts: 4

Participants: 2

Read full topic

ESP8285 RGBWW Flash and configure mini-tutorial

$
0
0

@dougle03 wrote:

Nice little Sat afternoon project.


Bought a couple of the generic WiFi RGB+WW (Cold and warm white) controllers.
Cracked one open to find an ESP8285 embedded, and 5 beefy outputs the data says 4amps for each of the outputs, I’m not sure I’d go that far but they are certainly higher rated than most OEM modules.

Amazon UK Link

Flashing is possible using pogo pins; I chose to solder -
The back of the board has legends printed for connections, and as an added bonus the reset switch shorts GPIO0 so nice and easy.

The ESPHome header for these boards is:

esphome:
  name: name_it
  platform: ESP8266
  board: esp01_1m

Finding the correct pins for the outputs took some time and lots of flashing;

output:
  - platform: esp8266_pwm
    id: output_component1
    pin: 12
    max_power: 100%
  - platform: esp8266_pwm
    id: output_component2
    pin: 14
    max_power: 100%
  - platform: esp8266_pwm
    id: output_component3
    pin: 13
    max_power: 100%
  - platform: esp8266_pwm
    id: output_component4
    pin: 5
    max_power: 100%
  - platform: esp8266_pwm
    id: output_component5
    pin: 15
    max_power: 100%

And the assignments:

light:
  - platform: rgbww
    name: "Name to show up in HA"
    red: output_component1
    green: output_component2
    blue: output_component3
    cold_white: output_component4
    warm_white: output_component5
    cold_white_color_temperature: 6536 K
    warm_white_color_temperature: 2000 K

Enjoy!

Posts: 1

Participants: 1

Read full topic

ESPHome w/ PN532 - Inconsistent Reads

$
0
0

@anthonyjestin wrote:

Hey folks! Just wanted to ping the hive mind about something.

I have successfully gotten my PN532 NFC reader online. My application requires that the binary sensor for a recognized tag be set to “ON” for as long as the tag is in the field of the reader, and goes to “OFF” when I remove the tag form the field.

The weird issue I am having is that one batch of tags I purchased a while back seems to do this. As long as I hold the tag in the reader field, it remains as “ON” in home assistant, and when removed it changes to “OFF”. However, a new batch of tags i received this week seems to be recognized for 1s (based on my update interval, i assume) and then immediately set itself to off, even though it doesn’t move out of the field.

The tags I purchased in June are THESE and the tags i jsut received are THESE

Both tags are NTAG215, and i can’t really see why they would react differently.

I also tried changing my update_interval, but then there seems to be no way to turn it off within the update interval period. I will need the tag to sometimes read off after 30 minutes and sometimes after 4 hours or more.

esphome:
  name: boardgame_nfc
  platform: ESP8266
  board: nodemcuv2

wifi:
  ssid: REDACTED
  password: REDACTED

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Boardgame Nfc Fallback Hotspot"
    password: REDACTED

captive_portal:

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:

spi:
  clk_pin: D0
  miso_pin: D1
  mosi_pin: D2

pn532:
  cs_pin: D3
  update_interval: 1s
  
binary_sensor:
  - platform: pn532
    uid: 04-B5-81-0A-28-5E-80
    name: "Playing Suburbia"
  - platform: pn532  
    uid: 04-2D-80-0A-28-5E-81
    name: "Playing Quacks of Quedlinburg"
  - platform: pn532
    uid: 04-FF-9F-1A-2E-66-80
    name: "Playing Anachrony"

Hoping anyone out there might have some thoughts before i order a new batch of the previous tags to try them out.

Thanks!

Anthony

Posts: 1

Participants: 1

Read full topic

Track a gas meter with ESPHome

$
0
0

@Armin wrote:

Hi,
i have a gas meter i want to track in Home Assistant. I have attached a reed switch to the gas meter and every time the second decimal place completes one turn the switch gets triggered.

I have created a pulse counter with ESPHome and a utility meter inside Home Assistant that tracks the total daily usage based on the pulse counter. However this is a very unprecise way of measurement, because the pulse meter often lags behind. I believe this is caused by the fact that the gas meter often is not turning at all, because no gas is used (see the attached picture) and ESPHome takes a few seconds to “realize” this and correct the value. Please correct me if i missunderstoof the functioning of the pulse counter.

chrome_2020-01-12_10-48-37
Gas consumption in m³/min

I also implemented a template sensor in ESPHome that simply counts the number of times the reed switch got triggered. This value perfectly corresponds to the actual value on the meter.

Im unsure where to go from here. While the second method results in precise values, im unsure how to implement this in Home Assistant. I also see the problem, that in the case of a power loss the esp loses the value and the whole measurement gets thrown off.

Posts: 2

Participants: 2

Read full topic

Is ESPHome able to SEND BT/BLE commands?

$
0
0

@iz3man wrote:

I have an electric terrasse IR heater that is controlled by BT. I haven’t found any way to integrate it into HA.
Now i read that ESPHome can read BT signals (like from Xiaomi Flora and thermometers).
Is it able to SEND specific BT commands as well, so I could turn my heat on/off?

Posts: 4

Participants: 2

Read full topic

LCD Display, show more sensors, what is the right syntax

$
0
0

@slindberg wrote:

Hi Guys.

I Started yesterday to play with lcd display for the first time, I set a 20x4 lcd display up with my Nodemcu esp32s board with esphome, and it works great. I have until now added a temperature sensor via home assistant to show the state on the display, my problem is how to add more sensor data to the display…

The problem is the right syntax combination of if, else, then, that I need help to.
The temp sensor is working fine, but I want to add the humidity sensor too, but I get error after uploading the code to the esp32s…

Can someone please guide me the right way ?

My code is posted here under:

display:
  - platform: lcd_pcf8574
    dimensions: 20x4
    address: 0x27
    lambda: |-
      
      it.print(0, 0, "Temp:");
      if (id(sensenode_temp_2).state == id(sensenode_temp_2).state) {
      it.printf(5, 0,"%.1fC", id(sensenode_temp_2).state);
      } else {
      it.print(0, 1, "Humidity:");
      if (id(sensenode_humidity_2).state == id(sensenode_humidity_2).state) {
      it.printf(5, 1,"%.1fC", id(sensenode_humidity_2).state);
      } else {
      it.print(0, 2, "Enheden startes");
      }

Best Regard slindberg

Posts: 2

Participants: 1

Read full topic


Which one is the right tasmota bin file for sonoff mini DIY?

$
0
0

@Josep wrote:

I flashed sonoff-basic.bin tasmota file in some sonoff mini DIY devicers I have, but home assistant don’t discover any oif the devices. I read a lot about this, and seems my config is right (in fact, other tasmota devices, like some rgb bulbs were discovered fine) and it seems devices with tasmota’s sonoff-basic firmware aren’t auto discovered.

Sonoff mini devices have a 500k limitation, and I am not sure if I should use the update firmware option or which file should I download and flash, to avoid brick it…

Posts: 1

Participants: 1

Read full topic

ESPHome Sonoff Basic to emulate Tasmota

$
0
0

@DaveTiff wrote:

Hi I have used Tasmota with Sonoff basic for a while but cant get ESPHome to work in the exact same way.

In the Tasmota version has the green LED showing WiFi status (i.e. 3 flashes when not connected) and the LED is “On” or “Off” with the relay. And switch Toggles the relay.

In ESPHome I can get the LED to follow the relay, and the switch to toggle the relay but its stops the WiFi not connected function.

Any body done this? or should it naturally work the same?

Regards, Dave

Posts: 1

Participants: 1

Read full topic

ESPHome: getting started with custom boards

$
0
0

@prankousky wrote:

Hi everybody,

do any of you have experience designing custom boards and would help me get started for my ESPhome project? I want to create my own multisensor fitting my needs. Below is a minimalistic version on a (some) breadboard(s). It contains

Obviously, this is just for testing purposes, so it doesn’t matter that it looks messy. However, I am currently trying to build a prototype that I can actually use, so it needs to

  • fit into a mounting box
  • be soldered to a board
  • give me the option to replace parts (see below)

What will be different compared to the device above?

  • additional reed sensor (as I want the states for two windows next to each other)
  • additional BME280 sensor for temperature, humidity, pressure
  • sensor being connected via MCP23017 I/O Expander so that I will have the option to connect more sensors without running out of PINs

In order to quickly be able to replace parts, both the nodeMCU v.1 and the MCP23017 are not soldered to the board itself, but rather plugged into fitting header pins that I previously soldered to the board.

This is what my board currently looks like; I know, it is awful! That’s why I started this thread.


This is my code; after flashing, I see this is the debug output (via serial), so I can assume that I soldered things okay… otherwise it wouldn’t detect the device at 0x20.

[13:33:02][C][i2c:028]: I2C Bus:
[13:33:02][C][i2c:029]:   SDA Pin: GPIO14
[13:33:02][C][i2c:030]:   SCL Pin: GPIO12
[13:33:02][C][i2c:031]:   Frequency: 50000 Hz
[13:33:02][I][i2c:033]: Scanning i2c bus for active devices...
[13:33:02][I][i2c:040]: Found i2c device at address 0x20

substitutions:
  devicename: flur_oben
  upper_devicename: Flur Oben


esphome:
  name: $devicename
  platform: ESP8266
  board: nodemcuv2

ota: 
  safe_mode: True
  password: much_secret
  port: very_port

api:

logger:
  level: debug

wifi:
  ssid: !secret wifi_name
  password: !secret wifi_password

web_server:
  port: 80
  auth:
    username: such_username
    password: very_secret_too

text_sensor:
  - platform: version
    name: "${upper_devicename} remote Version"
  - platform: wifi_info
    ip_address:
      name: "${upper_devicename} remote IP"
    ssid: 
      name: "${upper_devicename} remote SSID"
    bssid:
      name: "${upper_devicename} remote BSSID"

i2c:
  - id: bus_a
    sda: D5
    scl: D6
    scan: True

I could work with this, but I would prefer not to; my soldering job is embarrassing even for a hobbyist such as myself. Usually I’d say I can do at least a decent job soldering things, but these pins are too close to each other and that makes it very difficult for me. I will keep working on this, but just so that I see how well my prototype works. For the actual devices I’ll want to use (which will be quite a bunch as I need one per window / door; even though not all of them need all those sensors from above, at least one per room does).

I need >30 of these around the house, so it would be so much easier to work with a template board that doesn’t require me to solder all connections over and over again…

Have any of you got experience creating custom boards and would be willing to help me out?

The finished board would require

  • header pins for nodeMCU
  • header pins for MCP23017
  • connections between the two devices (what is currently done via those red, yellow, black and orange wires by me in the images above)
  • connections between the MCP23017 and a bunch of terminal screw headers and speaker terminals (for the reed sensors)

I currently only have two I/O terminal screw headers, but should probably just use those I pictured below, as the sensors usually require at least 3 pins (VCC, GND, DATA; or more). I am open to suggestions here as I don’t know what’s best practice.

grafik
grafik

I am using the free software Fritzing to create overviews of my projects (so that I’ll remember how to wire what without making mistakes when re-building things); this even has an option to show what the board would look like, but I have no idea how to go from there

My “overview” just to remember how to wire what

The supposed board

(

This is not a finished version of the multisensor I want to build as the MCP23017 is not included in the sketch. I just added it today and didn’t create a new file for it yet. Will work on that now. But how do I go from here?

Thank you in advance for any ideas :slight_smile:

Posts: 2

Participants: 2

Read full topic

Stepper motor not working

$
0
0

@DaAppLab wrote:

Hello all,

I currently switched from Tasmota to ESPHome so I am quite new to ESPHome.
Today I wanted to set up an ULN2003 Stepper motor with ESPHome but it is sadly not working as expected. I was following the official tutorial.

I have connected the esp and the motor to separated power sources. The ESP is running on 5V 1A and the motor on 5V 10A.
pin connections are:

  • d0 -> IN1
  • d1 -> IN2
  • d2 -> IN3
  • d3 -> IN4

This is the motor part from the esphome yaml:

# Enable Home Assistant API
api:
  services:
    - service: control_stepper
      variables:
        target: int
      then:
        - stepper.set_target:
            id: my_stepper
            target: !lambda 'return target;'
ota:

# Example configuration entry
stepper:
  - platform: uln2003
    id: my_stepper
    pin_a: D0
    pin_b: D1
    pin_c: D2
    pin_d: D3
    max_speed: 250 steps/s

    sleep_when_done: true

    # Optional:
    #acceleration: inf
    #deceleration: inf

this is the part from the Home Assistant configuration.yaml:

input_number:
  stepper_control:
    name: Stepper Control
    initial: 0
    min: -1000
    max: 1000
    step: 1
    mode: slider

automation:
  - alias: Write Stepper Value to ESP
    trigger:
      platform: state
      entity_id: input_number.stepper_control
    action:
      # Replace livingroom with the name you gave the ESP
      - service: esphome.my_stepper
        data_template:
          target: '{{ trigger.to_state.state | int }}'

I already looked at the other thread but I cannot figure out what I am doing wrong here. The Esp is showing up in HA but when I drag the slider around nothing happens…
What could I be doing wrong?

Any help is greatly appreciated!!

Posts: 2

Participants: 1

Read full topic

Device stuck on boot

$
0
0

@martyouel wrote:

Hi,
I am building a new garage door controller running ESPHOME.
That’s my first steps in ESPHOME.

Here’s the hardware of my unit (NodeMCU + Reed switch + DHT22 sensor + 5V 2-Channel Relay Module).

All works good on the workbench except one thing ; when I unplug and replug my nodemcu, the booting process stuck. If I want to boot the device I have to unplug the relay module, plug-in the nodemcu and as soon as the nodemcu is booted, I can replug the relay module.

Here’s my pin connection :

NodeMCU VIN --> Relay VCC
NodeMCU Ground --> Relay Ground
NodeMCU D6 --> Relay IN1
NodeMCU D8 --> Relay IN2

When I power the nodemcu, the relay IN1 is quickly “clicking”, the light IN1 on the relay board turn on and after that, nothing else happen. This look to stuck the booting process of the nodemcu.

If I removed the connection VIN --> VCC and power up the nodemcu unit everything is fine. I can then, while the nodemcu is powered up, re-connection the VIN --> VCC and the relay work good.

After some guess and try, I tried using a 3.3v pîn rather than the VIN pin of the nodemcu. By using the 3.3v the booting process is good, no stuck at all, but when I power up the relay with only 3.3v, only one channel is working on the relay.

Here’s my node config :

switch:
  - platform: gpio
    pin: 
        number: D6
        inverted : True        
    id: relay2
    restore_mode : ALWAYS_OFF

  - platform: gpio
    pin:
      number: D8    
      inverted : True        
    id: relay1
    restore_mode : ALWAYS_OFF

Any help would be appreciated.

Posts: 2

Participants: 2

Read full topic

Viewing all 1486 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>