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

Where is my logic wrong here?

$
0
0

@ashscott wrote:

For reasons that I can’t yet fathom, when the two binary sensors, drum_wash_low_level_switch and drum_low_level_switch coincide after the first boot, the final ‘then:’ actions don’t occur and on the second coincidence, the actions occur instantly rather than after the ‘for:’ time.

  - platform: gpio
    name: "Drum wash low level switch"
    pin:
      pcf8574: expander_1
      number: 4
      mode: INPUT
      inverted: False
    id: drum_wash_low_level_switch
    on_press:
      then:
        - switch.turn_off: drum_wash_pump
        - if:
            condition:
              and:
                - binary_sensor.is_on: drum_wash_low_level_switch
                - binary_sensor.is_on: drum_low_level_switch
            then:
              - binary_sensor.template.publish:
                  id: drum_empty
                  state: ON
        - if:
            condition:
              for:
                time: !lambda 'return id(drum_fault_detection_time).state * 1000;'
                condition:
                    - binary_sensor.is_on: drum_empty
            then:
              - binary_sensor.template.publish:
                  id: drum_filter_recovery_mode
                  state: ON
              - binary_sensor.template.publish:
                  id: enable_water_fill
                  state: OFF
              - switch.turn_on: water_fill_valve

Any clue what may be causing this?

Posts: 1

Participants: 1

Read full topic


Getting two temperature values from BME280

$
0
0

@muchtall wrote:

I just started playing with the BME280, and I’ve come across something odd that I’m hoping someone can explain. I’m seeing two differing charts for temperature data when I pull up the sensor:

image

The pressure and humidity sensors are only showing one set of values as would be expected. Why am I seeing two graphs for the temp?

EDIT: So it appears to be a more recent set of values along side the historical lookback. Why would I just see this behavior here? The scale of the recent values graph also seems to be arbitrary. I pulled it up again, and now it’s only showing the past ~2-3 minutes.

Here is my esphome yaml:

esphome:
  name: bme280_wemos_01
  platform: ESP8266
  board: d1_mini

wifi:
  ssid: "<redacted>"
  password: "<redacted>"

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Bme280 Wemos 01 Fallback Hotspot"
    password: "<redacted>"

captive_portal:

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:

### BME280 Setup
i2c:
  sda: 4  # D2/SDA/GPIO4 on Wemos D1 mini
  scl: 5  # D1/SCL/GPIO5 on Wemos D1 mini
  scan: True

sensor:
  - platform: bme280
    update_interval: 60s
    address: 0x76
    temperature:
      name: "BME280 Temperature"
    pressure:
      name: "BME280 Pressure"
    humidity:
      name: "BME280 Humidity"

Posts: 2

Participants: 2

Read full topic

Yet another topic about BME280

$
0
0

@Anelito wrote:

I’m quite new to the ESPhome but I think I’ve pretty much understood its working principles thanks to the excellent tutorials and guides. Now I was trying to make a simple environmental sensing station using a Wemos D1 mini lite, a BME280 and a MAX44009 light sensor.

I wired them to the D1 and D2 pins and everything seemed to work, I was getting good values and the sensors were responding to external stimuli. I turned off the PC and came back after an hour.
Well, I don’t know what happened during my absence but now both the I2C sensors are not working. Here the error:

[C][bme280.sensor:081]: Setting up BME280...
[20:11:38][W][i2c:070]: Received NACK on transmit of address 0x76
[20:11:38][E][component:092]: Component was marked as failed.

the resulting values for the BME are all nan while the light intensity is 0.000.
Running an I2C scanner sketch on the Wemos I can see the sensors at 0x76 and 0x4A, as in the code.

Here is the code, should be correct as it was taken from the official guide

i2c:
  sda: 4
  scl: 5
  scan: true

sensor:

  - platform: custom
    lambda: |-
      auto lux_sensor = new MAX44009Sensor();
      App.register_component(lux_sensor);
      return {lux_sensor};
  
    sensors:
      name: "Ambient Light"
      id: max44009
      state_topic: ${device_name}/feeds/light
      unit_of_measurement: 'lux'
      accuracy_decimals: 1

  - platform: bme280
    address: 0x76
    temperature:
      name: "Temperature"
      id: bme280_temperature
      state_topic: ${device_name}/feeds/temperature
      unit_of_measurement: '°C'
      discovery: True
      filters: []
    pressure:
      name: "Pressure"
      id: bme280_pressure
      state_topic: ${device_name}/feeds/pressure
      unit_of_measurement: 'hPa'
      discovery: True
      filters: []
    humidity:
      name: "Relative Humidity"
      id: bme280_humidity
      state_topic: ${device_name}/feeds/rel_humidity
      unit_of_measurement: '%'
      discovery: True
      filters: []
    update_interval: ${update_interval}

Posts: 1

Participants: 1

Read full topic

Have i bricked my first device ? Deltaco SH-P01

$
0
0

I bought 3 of these inexpensive little wall plugs after reading this topic: Deltaco SmartHome

So two of them won’t flash in Tuya Convert but one of them did so let’s focus on that one first. After the usual tips and trix I got it flashed with Tuya Convert and then I flashed it with a ESPhome bin. But something went wrong during the ESP flash and now the device only shows up as the fallback hotspot. The real problem is that a can’t log in to that fallback network. I only get wrong password…:frowning: So please tell me…is this my first brick ?

This is the code that I compiled and flashed:

esphome:
  name: smartplug_deltaco_1
  platform: ESP8266
  board: esp01_1m

wifi:
  ssid: “XXX”
  password: “xxxxxxxxxxxx”
  
  # ...
  manual_ip:
    # Set this to the IP of the ESP
    static_ip: 192.168.1.230
    # Set this to the IP address of the router. Often ends with .1
    gateway: 192.168.1.1
    # The subnet of the network. 255.255.255.0 works for most home networks.
    subnet: 255.255.255.0
  
  
  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Smartplug Deltaco 1"
    password: “1357908642”

captive_portal:

# Enable logging
logger:

# Enable Home Assistant API
api:
  password: “1357908642”

ota:
  password: “…”

binary_sensor:
  - platform: gpio
    pin:
      number: GPIO13
      mode: INPUT_PULLUP
      inverted: True
    name: "Deltaco SH-P01 Button"
    on_press:
      - switch.toggle: deltaco_relay_1
  - platform: status
    name: "Deltaco SH-P01 Status"

output:
  - platform: esp8266_pwm
    id: deltaco_smartplug_blue_led
    pin:
      number: GPIO5
      inverted: True
      
switch:
  - platform: gpio
    name: "Deltaco SH-P01 Relay"
    id: deltaco_relay_1
    pin: GPIO12

light:
  - platform: monochromatic
    name: "Deltaco SH-P01 blue LED"
    output: deltaco_smartplug_blue_led

4 posts - 2 participants

Read full topic

Display time from HA template on ESPHome display

$
0
0

I have a template sensor that displays the time half an hour before sun set.

sensor:
- platform: template
  sensors:
    sun_sun_time_sunset_offset_template:
      value_template: '{{ (as_timestamp(states.sun.sun.attributes.next_setting) -1800) | timestamp_custom("%H:%M") }}'

I want to display it on a SSD1306 display on an ESPHome managed nodemcu.

In ESPHome I defined the sensor:

sensor:
  - platform: homeassistant
    id: sun_sun_time_sunset_offset_template
    entity_id: sensor.sun_sun_time_sunset_offset_template
    internal: true

and added this sensor to the display lambda

lambda: |-
  it.printf(  0,  8, id(my_font1), "%s", id(sun_sun_time_sunset_offset_template).state);

The error I get is:

src/main.cpp: In lambda function:
src/main.cpp:466:84: warning: format '%s' expects argument of type 'char*', but argument 6 has type 'double' [-Wformat=]
       it.printf(  0,  8, my_font1, "%s", sun_sun_time_sunset_offset_template->state);

I don’t understand how to set it correct.

2 posts - 2 participants

Read full topic

ESP32 DHT11 Sensor Problem

$
0
0

Helllo everyone !
i have a problem that i could use some help with , i installed home assistant and using ESPHOME to control relays using my ESP32 , the relays code works very well , but then i decided to add a DHT11 sensor to my yaml and problems started showing :

INFO Uploading /data/bitanas/.pioenvs/bitanas/firmware.bin (890512 bytes)
Uploading: [============================================================] 100% Done...

INFO Waiting for result...
INFO OTA successful
INFO Successfully uploaded program.
INFO Starting log output from 192.168.1.200 using esphome API
INFO Connecting to 192.168.1.200:6053 (192.168.1.200)
WARNING Initial connection failed. The ESP might not be connected to WiFi yet (Error connecting to 192.168.1.200: timed out). Re-Trying in 1 seconds
INFO Connecting to 192.168.1.200:6053 (192.168.1.200)
WARNING Initial connection failed. The ESP might not be connected to WiFi yet (Error connecting to 192.168.1.200: [Errno 111] Connection refused). Re-Trying in 1 seconds
INFO Connecting to 192.168.1.200:6053 (192.168.1.200)
WARNING Initial connection failed. The ESP might not be connected to WiFi yet (Error connecting to 192.168.1.200: [Errno 111] Connection refused). Re-Trying in 2 seconds
INFO Connecting to 192.168.1.200:6053 (192.168.1.200)
WARNING Initial connection failed. The ESP might not be connected to WiFi yet (Error connecting to 192.168.1.200: [Errno 111] Connection refused). Re-Trying in 3 seconds
INFO Connecting to 192.168.1.200:6053 (192.168.1.200)

it gets stuck there , but once i remove the sensor code , everything goes back to normal and working.
i removed my relay code and left only the sensor code , the error shows up again.

i really wish i had more knowledge in order to fix this by my self but i’m stuck :frowning: can anyone help me ?

here is the code for my yaml file :


esphome:
  name: bitanas
  platform: ESP32
  board: nodemcu-32s

wifi:
  ssid: "something"
  password: "something"
  manual_ip:
    static_ip: 192.168.1.200
    gateway: 192.168.1.1
    subnet: 255.255.255.0

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

captive_portal:

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:

sensor:
  - platform: dht
    pin: 14
    model: AUTO_DETECT
    temperature:
      name: "Temperature"
    humidity:
      name: "Humidity"
    update_interval: 20s
    
switch:
    
  - platform: gpio
    name: "Relay_1"
    pin: 27
    inverted: True
    restore_mode: RESTORE_DEFAULT_OFF
    
  - platform: gpio
    name: "Relay_2"
    pin: 25
    inverted: True
    restore_mode: RESTORE_DEFAULT_OFF
    
  - platform: gpio
    name: "Relay_3"
    pin: 26
    inverted: True
    restore_mode: RESTORE_DEFAULT_OFF

1 post - 1 participant

Read full topic

Reboot script built in to ESPhome

$
0
0

I had searched for a bit to try and find a way to make a device always want to be on no matter what but would be easy to trigger an off cycle for rebooting a modem or router even if I am gone from home and using a VPN or something else to access my installation. Below is the full YAML that I used to do this and wanted to share it with anyone else who may have a need. Basically the device defaults to an on state so if there is a power outage it will turn back on, if the button is pressed it will turn off, wait 30 seconds and then turn back on and the same goes for a signal sent from Home Assistant.

I have been using this for a couple weeks on my router, modem, and access point without issue and it pretty well keeps them up and running. I will say that you may want to set a static IP address if your router and AP are separate devices as if the AP is working but the router is not fully booted you could end up with a boot loop otherwise set the reboot timer in ESPhome for a longer time so that all devices needed will be up and running. When I first put my router on this script the device would connect to wifi but not get an IP address then revert to it’s own AP mode then eventually reboot which was right about the time that the router was fully operational. Setting a static IP address fixed this as even if the router is not fully booted once it connects to the AP it has the ability to talk to my Home Assistant install which also has a static IP. This has worked excellent for my modem though as before I had to unplug it and then wait for a few and plug it back in. Now I can just trigger the switch in Home Assistant and walk away as it will wait 30 seconds and then power back up. This is the YAML for my Sonoff Basic but with a couple tweaks should work for just about anything.

esphome:
  name: device
  platform: ESP8266
  board: esp01_1m
  on_boot:
    priority: -10
    # turn power on at boot
    then:
      - switch.turn_on: relay
wifi:
  ssid: "WiFi-SSID"
  password: "supersecretpassword"

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Device Fallback Hotspot"
    password: "anothersecretpassword"
captive_portal:

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:


binary_sensor:
  - platform: gpio
    pin:
      number: GPIO0
      mode: INPUT_PULLUP
      inverted: True
    name: "Device Button"
    on_press:
      - switch.turn_off: relay
      - delay: 30s
      - switch.turn_on: relay
switch:
  - platform: gpio
    name: "Device"
    pin: GPIO12
    id: relay
    icon: "mdi:device"
    on_turn_off:
    - switch.turn_off: relay
    - delay: 30s
    - switch.turn_on: relay
status_led:
  pin:
    number: GPIO13
    inverted: yes

1 post - 1 participant

Read full topic

ESPHome - Convert minutes to HH:MM string using lambda

$
0
0

Need some help here - I am building an ESPHome based project which includes a timer, which will be displayed on a local display.

Where possible everything for this project will be done locally on the ESP, with remote control via HA also posssible but not mandatory.

My issue is the timer. I can count and display minutes, but since run times for this project will be measured in hours - up to 48 hrs in some instances, just displaying minutes is not acceptable.

I would like to display as HH:MM. I have tried coding this using a template text_sensor in ESPHome, using lambda, also using lambda in just my display code. Either way I get a bunch of compile time errors related to variable type or syntax errors, mostly I believe because of the non-standard C++ interpretation. Things like: value=source%60 (to get remainder) throw wierd errors about binary values, so I am obviously struggling here. The (currently not working) code looks like:


  - platform: template
    name: "ESPHome Formatted Proof Time"
    id: loc_proof_time
    lambda: |-
      if (id(time_on).state == 0) {
        return {"0:00"};
      } else {
        int hr, min;
        hr = id(time_on).state/60;
        min = id(time_on).state%60;
        return {hr.c_str() + ":" + min.c_str()};
      }

This throws the following errors at compile time:


Compiling /data/proofingbox_control/.pioenvs/proofingbox_control/src/main.cpp.o
src/main.cpp: In lambda function:
src/main.cpp:765:30: error: invalid operands of types 'float' and 'int' to binary 'operator%'
         min = time_on->state%60;
                              ^
src/main.cpp:766:20: error: request for member 'c_str' in 'hr', which is of non-class type 'int'
         return {hr.c_str() + ":" + min.c_str()};
                    ^
src/main.cpp:766:40: error: request for member 'c_str' in 'min', which is of non-class type 'int'
         return {hr.c_str() + ":" + min.c_str()};
                                        ^
src/main.cpp:766:47: error: could not convert '{<expression error>}' from '<brace-enclosed initializer list>' to 'esphome::optional<std::__cxx11::basic_string<char> >'
         return {hr.c_str() + ":" + min.c_str()};
                                               ^
*** [/data/proofingbox_control/.pioenvs/proofingbox_control/src/main.cpp.o] Error 1

I can quite easily take the minutes value and convert in HA:


  - platform: template
    sensors:
      proof_runtime:
        value_template: >
            {% set pt = states('sensor.time_on') | int %}
            {% if pt == 0 %}
              {{ '0:00' }}
            {% elif pt > 1 %}
              {{ pt // 60 }}:{{ '{:0>2d}'.format(pt%60) }}
            {% endif %}

I can then read this value on the ESP and display it using a text sensor, and that will be my last resort, but would still rather do this in ESPHome.

Any ideas?

2 posts - 1 participant

Read full topic


Display using ESPHome - can you guide me for a good tutorial?

$
0
0

Hi,

I would like to add a small display on my desk, showing the value of a couple of sensors taken from my HA. Can you guide me to a good tutorial, giving good details of hardware required, and coding please?
I am not a totally noob since I already used ESPHome for a multisensor (temp, humidity and motion)

Any guidance will be appreciated :slight_smile:

2 posts - 1 participant

Read full topic

Water quality pH0-14 Sensor

$
0
0

Hi. Now that the warm season has started again, we would like to put a small pool in our garden. So that the water quality is right, I would like to measure the “pH value”. This is of course very easy, or a little more complicated. Of course, I opted for the complicated variant. Now I have also found a sensor that can measure the “pH value” [This one](#Aliexpress € 4,53 | Flüssigkeit PH0-14 Wert Erkennen Sensor Modul + Ph-elektrode Sonde BNC für Arduino https://a.aliexpress.com/_BSB8Q8) I would like to have this displayed via ESPHome in HA. The sensor is not listed on the ESPHome.io site. But I know that it is an analog sensor. Can I integrate it like my “Soil Moisture Sensors”? Has anyone done this before? Does anyone have any experience or tips? I would be grateful for information …
Regards

5 posts - 1 participant

Read full topic

Problem re-uploading code to ESPHome

$
0
0

I wanted to update one of my devices running ESP Home.
Its a Magic Home LED controller that I’ve flashed with ESP home and while it worked fine the first time I flashed it I wanted to change the code a little bit and got this error message telling me that I’m not connected to the internet.
I’m right now on 0.111.2
As for the ESPhome Yaml file - I’m confident that its OK (It worked the first time and I have ~14 other devices with similar code that is OK (With the exception of another one but it’s a different symptom).
Anyone have any suggestions on what could be wrong in this case ?

Thanks

INFO Reading configuration /config/esphome/raindance_esp_rgb_strip_4.yaml...
INFO Generating C++ source...
INFO Compiling app...
INFO Running:  platformio run -d /config/esphome/raindance_esp_rgb_strip_4
Processing raindance_esp_rgb_strip_4 (board: esp01_1m; framework: arduino; platform: espressif8266@2.2.3)
--------------------------------------------------------------------------------
HARDWARE: ESP8266 80MHz, 80KB RAM, 1MB Flash
Looking for ESPAsyncTCP-esphome library in registry
Warning! You are not connected to the Internet.
If you build a project first time, we need Internet connection to install all dependencies and toolchains.
Looking for ESPAsyncWebServer-esphome library in registry
Warning! You are not connected to the Internet.
If you build a project first time, we need Internet connection to install all dependencies and toolchains.
Warning! You are not connected to the Internet.
If you build a project first time, we need Internet connection to install all dependencies and toolchains.
Dependency Graph
|-- <ESP8266WiFi> 1.0
|-- <ESP8266mDNS> 1.2
|   |-- <ESP8266WiFi> 1.0
|-- <DNSServer> 1.1.1
|   |-- <ESP8266WiFi> 1.0
Compiling /data/raindance_esp_rgb_strip_4/.pioenvs/raindance_esp_rgb_strip_4/src/esphome/components/api/api_connection.cpp.o
Compiling /data/raindance_esp_rgb_strip_4/.pioenvs/raindance_esp_rgb_strip_4/src/esphome/components/api/api_server.cpp.o
Compiling /data/raindance_esp_rgb_strip_4/.pioenvs/raindance_esp_rgb_strip_4/src/esphome/components/api/list_entities.cpp.o
Compiling /data/raindance_esp_rgb_strip_4/.pioenvs/raindance_esp_rgb_strip_4/src/esphome/components/api/subscribe_state.cpp.o
In file included from src/esphome/components/api/list_entities.h:52:0,
                 from src/esphome/components/api/list_entities.cpp:1:
src/esphome/components/api/api_server.h:19:25: fatal error: ESPAsyncTCP.h: No such file or directory

*********************************************************************
* Looking for ESPAsyncTCP.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:ESPAsyncTCP.h"
* Web  > https://platformio.org/lib/search?query=header:ESPAsyncTCP.h
*
*********************************************************************

 #include <ESPAsyncTCP.h>
                         ^
compilation terminated.
In file included from src/esphome/components/api/api_connection.h:7:0,
                 from src/esphome/components/api/api_connection.cpp:1:
src/esphome/components/api/api_server.h:19:25: fatal error: ESPAsyncTCP.h: No such file or directory

*********************************************************************
* Looking for ESPAsyncTCP.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:ESPAsyncTCP.h"
* Web  > https://platformio.org/lib/search?query=header:ESPAsyncTCP.h
*
*********************************************************************

2 posts - 2 participants

Read full topic

Esphome sonoff not recognized any more

$
0
0

Hi everyone, I have a Sonoff basic that I flashed with ESPHome some time back and left on a shelf due to no use. It’s been a few months and over the course of changes I have deleted the config in ESPHome at some point. The sonoff connects to Wifi but not in ESPHome.

Is there a way to recreate the config in ESPHome and would the device reconnect to it or do I have to restart from scratch and reflash it with USB ?

Thanks for your help!

1 post - 1 participant

Read full topic

Help with esphome lambda

$
0
0

I am trying to write a controller for my garage door and have run into a problem. To close the door I need to keep the relay switched on until the reed switch closes. To do this I have set up a lambda under the ‘close_action’ case in the esphome garage cover.

The lambda attempts to say:

  1. If the door is not closed, then set the door_state to ‘closing’ and flip the relay on
  2. While the door is closing, keep checking the closed_sensor state. If it flips to true, the door is closed. Set the door_state to closed and flip the relay back off

The first clause seems to work correctly, but when we get into the while loop it either freezes after around 10 loops, or freezes when I close the reed switch. I have to unplug the Sonoff to reset everything and try again.

yaml for esphome:

https://pastebin.com/ckAHyC1q

log output from esphome:

https://pastebin.com/SK6Re0wH]

I have absolutely no idea why this is happening and would really appreciate some help! I am also wide open to other solutions if there is a better way.

1 post - 1 participant

Read full topic

Esp32 lolin32 v1 weird behavior

$
0
0

Hello all,

I am using an ESP32 lolin32 v1 to automate some a small water pump that is placed in a large container filled with water. The pump is controlled with a relay and I also have a water level sensor like this one.

Basically this is a on/off type sensor. It worked fine until a few weeks ago when it stopped registering changes.
Here is my configuration file:

esphome:
  name: flowers
  platform: ESP32
  board: lolin32

wifi:
  ssid: !secret wifi-ssid
  password: !secret wifi-pass
  manual_ip:
    static_ip: 192.168.1.12
    gateway: 192.168.1.1
    subnet: 255.255.255.0

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: !secret flowers-ap-ssid
    password: !secret flowers-ap-pass

captive_portal:

# Enable logging
logger:

# Enable Home Assistant API
api:
  password: !secret flowers-api-pass
ota:
  password: !secret flowers-ota-pass

binary_sensor:
  - platform: gpio
    pin: 
      number: 19
      mode: INPUT_PULLUP
      inverted: false
    name: "Level Sensor"
    filters:
      - delayed_on: 30s
    id: level

switch:
  - platform: gpio
    pin: 26
    name: "Pump Switch"
    inverted: true
    id: pump
  - platform: restart
    name: "Flowers restart"
    id: restart_switch_flowers

time:
  - platform: homeassistant
    on_time:
      - seconds: 0
        minutes: 0
        hours: 4
        days_of_week: MON-SUN
        then:
           - switch.toggle: restart_switch_flowers

The only thing that is different from when it was working is the fact that the esphome addon started to behave strangely when I tried to add another esp32, stating that I wasn’t connected to the internet or something. Reading online I found that switching to the dev branch which was on version 1.15-dev would fix the problem. And it did (or it seems it did), only now I cannot read any values from this binary sensor. The water pump switch works fine. I also tried with another esp32 board (identical to the first one) and same result.

Anyone has any clue what is happening? Have they changed something that somehow failed to document? I found that the documentation is quite strange. For example:

Here is the documentation for the binary sensor on the esphome site. They say that the pin numbers should be addressed with D and a number. But in my file it I set pin: D23 it comes out with an error saying that there is no such pin…

9 posts - 2 participants

Read full topic

ESP Home - phantom devices

$
0
0

Guys,

I flashed an ESP32 for testing purposes to use a a BLE reader for some Xiaomi Temperature and humidity devices (i am fairly new at HA and ESPHome).

All went well so i decided to move the devices from my test area into the area where they will be used on an ongoing basis - when doing that i then added a 2nd Xiaomi sensor and did an OTA update - at this point what i wanted to do was

  1. Rename the ESPhome device so it showed correctly (as to location) in HA
  2. Rename the existing Xiaomi to the correct new name to represent its location
  3. Add the 3rd device

So i am having a couple of problems

  1. When i tried to rename the YAML and device it appeared that the YAML name dictates what DHCP name ESPHome looks for when trying to do OTA updates - even though i restarted my DHCP server and deleted the reservation in there it appeared that ESPHome still had this info cached somewhere so it was failing the OTA - so in the end i went back to the old name for the time being
  2. Even though i have renamed the sensors when i look at the MQTT stream (using MQTT-SPY) i can still see the old sensor being reported on (as well as the new name) - even though this does not show up in my YAML
  3. I have two of the same sensors - one i would like to show as Parents Bedroom Temp, Humidity and Battery - the other as Wardrobe Temp, Humidity and Battery (YAML snippet below) - however in the card in Lovelace (auto generated) - i am seeing the first device reported as just Temperature, Humidity and Battery (i.e. it is dropping the Bedroom at the start) - this is probably me just not understanding correct YAML syntax - any pointers for multiple sensors of the same type ?
esp32_ble_tracker:

sensor:
  - platform: xiaomi_lywsdcgq
    mac_address: 58:2D:34:32:DE:27
    temperature:
      name: "Parents Wardrobe Temperature"
    humidity:
      name: "Parents Wardrobe Humidity"
    battery_level:
      name: "Parents Wardrobe Battery Level"
  - platform: xiaomi_lywsdcgq
    mac_address: 58:2D:34:32:EF:C4
    temperature:
      name: "Parents Bedroom Temperature"
    humidity:
      name: "Parents Bedroom Humidity"
    battery_level:
      name: "Parents Bedroom Battery Level" 

image

Craig

5 posts - 2 participants

Read full topic


Pump Control

$
0
0

Hi
I posted on the 3rd May about differential temperature pump control. I have since tried to correct the YAML script without success. I have an error “Invalid YAML syntax: mapping values are not allowed here” line 56 col 23 (value_template:). Any help in resolving my problem will be much appreciated.
Script here.

esphome:
  name: "ha_diff_temps_test"
  platform: ESP32
  board: nodemcu-32s

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  manual_ip:
    static_ip: 192.168.1.102
    gateway: 192.168.1.1
    subnet: 255.255.255.0

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Ha Diff Temps Test"
    password: "xxxxxxxxxxxx"

captive_portal:

# Enable logging
logger:

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

ota:
  password: !secret ota

dallas:
  - pin: 23

# Individual Sensors
sensor:
  - platform: dallas
    address: 0xb80000030864ca28
    name: "panel"
    id: "panel"

  - platform: dallas
    address: 0x60000003084c2b28
    name: "tank"
    id: "tank"

  - platform: value_template
    id: Temperature Difference
    unit_of_measurement: °C
    update_interval: 60s
    lambda: 'return id(panel).state - id(tank).state;'

  - platform: template
    sensors:
    temp_diff:
      friendly_name: Temperature Difference
        value_template: >
          {% if ((states.sensor.panel_temperature.state | float ) - (states.sensor.tank_temperature.state | float))
            < (states.input_number.pump_on_offset.state | float ) %} pump_off
          {% elif ((states.sensor.panel_temperature.state | float ) - (states.sensor.tank_temperature.state | float))
            > (states.input_number.pump_on_offset.state | float ) %} pump_on
          {% else %} pending {% endif %}

input_number:
  pump_off_offset:
    name: Pump OFF offset
    initial: 0.1
    min: 0
    max: 2
    step: 0.1

  pump_on_offset:
    name: Pump ON offset
    initial: 3
    min: 0
    max: 2
    step: 0.5

automation:
  - id: ID12
    alias: 'Pump hot water if hotter than tank - stop if not'
    initial_state: 'on'
    trigger:
      platform: state
      entity_id: sensor.temp_diff
    action:
      entity_id: switch.solar_pump
      service_template: >
        {% if is_state ('sensor.temp_diff' , 'pump_on') %} switch.turn_on
        {% else %} switch.turn_off {% endif %}

Regards Adhoc77

1 post - 1 participant

Read full topic

ESPHome devices connect to WIFI but not API. Some work, some not

$
0
0

Having some weird problem with my ESP home devices. All seem to be online looking the ESPhome addon page and the router device list. OTA update works for all of them. One works on home assistant and most show “unavailable”. Some show logs and some says

WARNING Initial connection failed. The ESP might not be connected to WiFi yet (Error connecting to 192.168.2.216: [Errno 111] Connection refused).

I noticed first that my ESP32 reading pulses from main energy meter becomes unavailable every now and then. Everything has been working months without a glitch (that I have noticed at least).

I rebooted the ESP32 unplugging the power supply but did not seem to help. Then I OTA updated new code after power_save_mode: none. Now the real problems started. All other nodes started to act weird as well. As per first lines of this post. I tried rebooting the devices, the network equipment and finally everything. What could I do next?

For example this is what I get if uploading new code via OTA:

INFO Reading configuration /config/esphome/tv_backlight.yaml...
INFO Generating C++ source...
INFO Compiling app...
INFO Running:  platformio run -d /config/esphome/tv_backlight
Processing tv_backlight (board: esp01_1m; framework: arduino; platform: espressif8266@2.2.3)
--------------------------------------------------------------------------------
HARDWARE: ESP8266 80MHz, 80KB RAM, 1MB Flash
PACKAGES: 
 - framework-arduinoespressif8266 2.20502.0 (2.5.2) 
 - tool-esptool 1.413.0 (4.13) 
 - tool-esptoolpy 1.20600.0 (2.6.0) 
 - toolchain-xtensa 1.40802.0 (4.8.2)
Dependency Graph
|-- <ESPAsyncTCP-esphome> 1.2.2
|   |-- <ESP8266WiFi> 1.0
|-- <ESP8266WiFi> 1.0
|-- <ESP8266mDNS> 1.2
|   |-- <ESP8266WiFi> 1.0
Compiling /data/tv_backlight/.pioenvs/tv_backlight/src/esphome/components/api/api_connection.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/src/esphome/components/api/api_pb2.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/src/esphome/components/api/api_pb2_service.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/src/esphome/components/api/api_server.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/src/esphome/components/api/list_entities.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/src/esphome/components/api/proto.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/src/esphome/components/api/subscribe_state.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/src/esphome/components/api/user_services.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/src/esphome/components/api/util.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/src/esphome/components/esp8266_pwm/esp8266_pwm.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/src/esphome/components/light/addressable_light.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/src/esphome/components/light/light_state.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/src/esphome/components/logger/logger.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/src/esphome/components/ota/ota_component.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/src/esphome/components/output/automation.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/src/esphome/components/output/float_output.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/src/esphome/components/wifi/wifi_component.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/src/esphome/components/wifi/wifi_component_esp32.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/src/esphome/components/wifi/wifi_component_esp8266.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/src/esphome/core/application.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/src/esphome/core/component.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/src/esphome/core/controller.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/src/esphome/core/esphal.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/src/esphome/core/helpers.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/src/esphome/core/log.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/src/esphome/core/preferences.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/src/esphome/core/scheduler.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/src/esphome/core/util.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/src/main.cpp.o
Generating LD script /data/tv_backlight/.pioenvs/tv_backlight/ld/local.eagle.app.v6.common.ld
Compiling /data/tv_backlight/.pioenvs/tv_backlight/lib4d9/ESP8266WiFi/BearSSLHelpers.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/lib4d9/ESP8266WiFi/CertStoreBearSSL.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/lib4d9/ESP8266WiFi/ESP8266WiFi.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/lib4d9/ESP8266WiFi/ESP8266WiFiAP.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/lib4d9/ESP8266WiFi/ESP8266WiFiGeneric.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/lib4d9/ESP8266WiFi/ESP8266WiFiMulti.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/lib4d9/ESP8266WiFi/ESP8266WiFiSTA-WPS.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/lib4d9/ESP8266WiFi/ESP8266WiFiSTA.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/lib4d9/ESP8266WiFi/ESP8266WiFiScan.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/lib4d9/ESP8266WiFi/WiFiClient.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/lib4d9/ESP8266WiFi/WiFiClientSecureAxTLS.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/lib4d9/ESP8266WiFi/WiFiClientSecureBearSSL.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/lib4d9/ESP8266WiFi/WiFiServer.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/lib4d9/ESP8266WiFi/WiFiServerSecureAxTLS.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/lib4d9/ESP8266WiFi/WiFiServerSecureBearSSL.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/lib4d9/ESP8266WiFi/WiFiUdp.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/libde4/ESPAsyncTCP-esphome_ID6757/AsyncPrinter.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/libde4/ESPAsyncTCP-esphome_ID6757/ESPAsyncTCP.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/libde4/ESPAsyncTCP-esphome_ID6757/ESPAsyncTCPbuffer.cpp.o
Archiving /data/tv_backlight/.pioenvs/tv_backlight/lib4d9/libESP8266WiFi.a
Compiling /data/tv_backlight/.pioenvs/tv_backlight/libde4/ESPAsyncTCP-esphome_ID6757/SyncClient.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/libde4/ESPAsyncTCP-esphome_ID6757/tcp_axtls.c.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/lib0d3/ESP8266mDNS/ESP8266mDNS.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/lib0d3/ESP8266mDNS/ESP8266mDNS_Legacy.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/lib0d3/ESP8266mDNS/LEAmDNS.cpp.o
Archiving /data/tv_backlight/.pioenvs/tv_backlight/libde4/libESPAsyncTCP-esphome_ID6757.a
Compiling /data/tv_backlight/.pioenvs/tv_backlight/lib0d3/ESP8266mDNS/LEAmDNS_Control.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/lib0d3/ESP8266mDNS/LEAmDNS_Helpers.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/lib0d3/ESP8266mDNS/LEAmDNS_Structs.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/lib0d3/ESP8266mDNS/LEAmDNS_Transfer.cpp.o
Archiving /data/tv_backlight/.pioenvs/tv_backlight/libFrameworkArduinoVariant.a
Compiling /data/tv_backlight/.pioenvs/tv_backlight/FrameworkArduino/Esp-frag.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/FrameworkArduino/Esp-version.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/FrameworkArduino/Esp.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/FrameworkArduino/FS.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/FrameworkArduino/FunctionalInterrupt.cpp.o
Archiving /data/tv_backlight/.pioenvs/tv_backlight/lib0d3/libESP8266mDNS.a
Compiling /data/tv_backlight/.pioenvs/tv_backlight/FrameworkArduino/HardwareSerial.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/FrameworkArduino/IPAddress.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/FrameworkArduino/MD5Builder.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/FrameworkArduino/Print.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/FrameworkArduino/Schedule.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/FrameworkArduino/ScheduledFunctions.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/FrameworkArduino/StackThunk.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/FrameworkArduino/Stream.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/FrameworkArduino/StreamString.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/FrameworkArduino/Tone.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/FrameworkArduino/Updater.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/FrameworkArduino/WMath.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/FrameworkArduino/WString.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/FrameworkArduino/abi.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/FrameworkArduino/base64.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/FrameworkArduino/cbuf.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/FrameworkArduino/cont.S.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/FrameworkArduino/cont_util.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/FrameworkArduino/core_esp8266_app_entry_noextra4k.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/FrameworkArduino/core_esp8266_eboot_command.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/FrameworkArduino/core_esp8266_flash_utils.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/FrameworkArduino/core_esp8266_i2s.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/FrameworkArduino/core_esp8266_main.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/FrameworkArduino/core_esp8266_noniso.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/FrameworkArduino/core_esp8266_phy.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/FrameworkArduino/core_esp8266_postmortem.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/FrameworkArduino/core_esp8266_si2c.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/FrameworkArduino/core_esp8266_sigma_delta.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/FrameworkArduino/core_esp8266_timer.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/FrameworkArduino/core_esp8266_waveform.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/FrameworkArduino/core_esp8266_wiring.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/FrameworkArduino/core_esp8266_wiring_analog.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/FrameworkArduino/core_esp8266_wiring_digital.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/FrameworkArduino/core_esp8266_wiring_pulse.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/FrameworkArduino/core_esp8266_wiring_pwm.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/FrameworkArduino/core_esp8266_wiring_shift.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/FrameworkArduino/debug.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/FrameworkArduino/gdb_hooks.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/FrameworkArduino/heap.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/FrameworkArduino/libb64/cdecode.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/FrameworkArduino/libb64/cencode.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/FrameworkArduino/libc_replacements.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/FrameworkArduino/sntp-lwip2.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/FrameworkArduino/spiffs/spiffs_cache.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/FrameworkArduino/spiffs/spiffs_check.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/FrameworkArduino/spiffs/spiffs_gc.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/FrameworkArduino/spiffs/spiffs_hydrogen.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/FrameworkArduino/spiffs/spiffs_nucleus.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/FrameworkArduino/spiffs_api.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/FrameworkArduino/spiffs_hal.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/FrameworkArduino/sqrt32.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/FrameworkArduino/time.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/FrameworkArduino/uart.cpp.o
Compiling /data/tv_backlight/.pioenvs/tv_backlight/FrameworkArduino/umm_malloc/umm_malloc.cpp.o
Archiving /data/tv_backlight/.pioenvs/tv_backlight/libFrameworkArduino.a
Linking /data/tv_backlight/.pioenvs/tv_backlight/firmware.elf
Retrieving maximum program size /data/tv_backlight/.pioenvs/tv_backlight/firmware.elf
Checking size /data/tv_backlight/.pioenvs/tv_backlight/firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [====      ]  42.7% (used 35000 bytes from 81920 bytes)
Flash: [====      ]  37.4% (used 382828 bytes from 1023984 bytes)
Building /data/tv_backlight/.pioenvs/tv_backlight/firmware.bin
Creating BIN file "/data/tv_backlight/.pioenvs/tv_backlight/firmware.bin" using "/data/tv_backlight/.pioenvs/tv_backlight/firmware.elf"
========================= [SUCCESS] Took 29.96 seconds =========================
INFO Successfully compiled program.
INFO Resolving IP address of tv_backlight.local
INFO  -> 192.168.2.77
INFO Uploading /data/tv_backlight/.pioenvs/tv_backlight/firmware.bin (386976 bytes)
Uploading: [============================================================] 100% Done...

INFO Waiting for result...
INFO OTA successful
INFO Successfully uploaded program.
INFO Starting log output from tv_backlight.local using esphome API
INFO Connecting to tv_backlight.local:6053 (192.168.2.77)
INFO Successfully connected to tv_backlight.local
[11:06:58][I][app:100]: ESPHome version 1.14.4 compiled on Jun 18 2020, 11:06:11
[11:06:58][C][wifi:415]: WiFi:
[11:06:58][C][wifi:283]:   SSID: [redacted]
[11:06:58][C][wifi:284]:   IP Address: 192.168.2.77
[11:06:58][C][wifi:286]:   BSSID: [redacted]
[11:06:58][C][wifi:287]:   Hostname: 'tv_backlight'
[11:06:58][C][wifi:291]:   Signal strength: -52 dB ▂▄▆█
[11:06:58][C][wifi:295]:   Channel: 11
[11:06:58][C][wifi:296]:   Subnet: 255.255.255.0
[11:06:58][C][wifi:297]:   Gateway: 192.168.2.1
[11:06:58][C][wifi:298]:   DNS1: 192.168.2.1
[11:06:58][C][wifi:299]:   DNS2: (IP unset)
[11:06:58][C][esp8266_pwm:022]: ESP8266 PWM:
[11:06:58][C][esp8266_pwm:023]:   Pin: GPIO12 (Mode: OUTPUT)
[11:06:58][C][esp8266_pwm:024]:   Frequency: 1000.0 Hz
[11:06:58][C][esp8266_pwm:022]: ESP8266 PWM:
[11:06:58][C][esp8266_pwm:023]:   Pin: GPIO15 (Mode: OUTPUT)
[11:06:58][C][esp8266_pwm:024]:   Frequency: 1000.0 Hz
[11:06:58][C][esp8266_pwm:022]: ESP8266 PWM:
[11:06:58][C][esp8266_pwm:023]:   Pin: GPIO14 (Mode: OUTPUT)
[11:06:58][C][esp8266_pwm:024]:   Frequency: 1000.0 Hz
[11:06:58][C][esp8266_pwm:022]: ESP8266 PWM:
[11:06:58][C][esp8266_pwm:023]:   Pin: GPIO4 (Mode: OUTPUT)
[11:06:58][C][esp8266_pwm:024]:   Frequency: 1000.0 Hz
[11:06:58][C][logger:175]: Logger:
[11:06:58][C][logger:176]:   Level: DEBUG
[11:06:58][C][logger:177]:   Log Baud Rate: 115200
[11:06:58][C][logger:178]:   Hardware UART: UART0
[11:06:58][C][light:177]: Light 'tv_backlight_side_cold'
[11:06:58][C][light:179]:   Default Transition Length: 1.0s
[11:06:58][C][light:180]:   Gamma Correct: 2.80
[11:06:58][C][light:177]: Light 'tv_backlight_side_warm'
[11:06:58][C][light:179]:   Default Transition Length: 1.0s
[11:06:58][C][light:180]:   Gamma Correct: 2.80
[11:06:58][C][light:177]: Light 'tv_backlight_top_cold'
[11:06:58][C][light:179]:   Default Transition Length: 1.0s
[11:06:58][C][light:180]:   Gamma Correct: 2.80
[11:06:58][C][light:177]: Light 'tv_backlight_top_warm'
[11:06:58][C][light:179]:   Default Transition Length: 1.0s
[11:06:58][C][light:180]:   Gamma Correct: 2.80
[11:06:58][C][ota:029]: Over-The-Air Updates:
[11:06:58][C][ota:030]:   Address: tv_backlight.local:8266
[11:06:58][C][ota:032]:   Using Password.
[11:06:58][C][api:095]: API Server:
[11:06:58][C][api:096]:   Address: tv_backlight.local:6053

This is the code:

substitutions:
  name: "tv_backlight"
  friendly_name: "TV koristevalo"

esphome:
  name: ${name}
  comment: ${friendly_name}
  platform: ESP8266
  board: esp01_1m

wifi:
  networks:
  - ssid: !secret wlan_ssid
    password: !secret wlan_password
  - ssid: !secret wlan_iot_ssid
    password: !secret wlan_password
    
# Enable logging
logger:

# Enable Home Assistant API
api:
  password: !secret homeassistant_api_password
  
ota:
  password: !secret ota_password
  
output:
  - platform: esp8266_pwm
    pin: GPIO12
    frequency: 1000 Hz
    id: side_cold

  - platform: esp8266_pwm
    pin: GPIO15
    frequency: 1000 Hz
    id: side_warm

  - platform: esp8266_pwm
    pin: GPIO14
    frequency: 1000 Hz
    id: top_cold

  - platform: esp8266_pwm
    pin: GPIO4
    frequency: 1000 Hz
    id: top_warm
  
light:
  - platform: monochromatic
    name: ${name}_side_cold
    output: side_cold
  - platform: monochromatic
    name: ${name}_side_warm
    output: side_warm
  - platform: monochromatic
    name: ${name}_top_cold
    output: top_cold
  - platform: monochromatic
    name: ${name}_top_warm
    output: top_warm

This is what the logs show from ESPHome (well the logs worked this time, logs from another device)

INFO Reading configuration /config/esphome/house_main_power.yaml...
INFO Detected timezone 'EET' with UTC offset 2 and daylight savings time from 28 March 03:00:00 to 31 October 04:00:00
INFO Starting log output from house_main_power.local using esphome API
INFO Connecting to house_main_power.local:6053 (192.168.2.216)
WARNING Initial connection failed. The ESP might not be connected to WiFi yet (Error connecting to 192.168.2.216: [Errno 111] Connection refused). Re-Trying in 1 seconds
INFO Connecting to house_main_power.local:6053 (192.168.2.216)
WARNING Initial connection failed. The ESP might not be connected to WiFi yet (Error connecting to 192.168.2.216: [Errno 111] Connection refused). Re-Trying in 1 seconds
INFO Connecting to house_main_power.local:6053 (192.168.2.216)
WARNING Initial connection failed. The ESP might not be connected to WiFi yet (Error connecting to 192.168.2.216: [Errno 111] Connection refused). Re-Trying in 2 seconds

This is how all of them appear on ESPhome addon page
image
image

So the device kind of is connected but entities are unavailable
image

Running home assistant supervised on ubuntu. Version: 0.110.1
ESPHome 1.14.4
Only one device is ESP32 and others ESP8266.

2 posts - 2 participants

Read full topic

ESPHOME Time and Sun Components

$
0
0

I’m looking to push all my automations from Homeassistant to ESPHome to avoid issues that arise when WiFi is disconnected or HA is down. Some of my automations use the Time and Sun components (e.g switch lights on 30 mins after sunset). So, my question is, what would happen to these automations if the ESPHome device (Sonoff Basic) is disconnected from the WiFi - potentially for an extended period of time - would they still run albeit not recently synchronised or would they just not run?

1 post - 1 participant

Read full topic

Support for AXP192 power management chip?

$
0
0

On this ESPHome documentation page: https://esphome.io/cookbook/leak-detector-m5stickc it shows an example using an M5Stick and includes support for the AXP192 power management chip. I tried borrowing the YAML for enabling that on my own M5Stick, but I’m getting an error message when I try to compile it " Platform not found: ‘sensor.axp192’. "

There is no AXP192 platform listed on esphome.io so where is this support supposed to come from? Is there some way to pull in additional Arduino libraries?

The relevant bits of YAML that I used:

    i2c:
       - id: bus_a
         sda: GPIO21
         scl: GPIO22
         scan: true
    
    sensor:
       - platform: axp192
         address: 0x34
         i2c_id: bus_a
         update_interval: 30s
         battery_level:
           name: "${friendly_name} Battery Level"
           id: "m5stick_batterylevel"

1 post - 1 participant

Read full topic

Trigger digital out when sensor is read

$
0
0

Hi, banging my head against the wall on this. Have a soil moisture reader that if i understand correctly will wear out if left on the whole time. Seeing examples on other platforms for how to use digital IO to power the sensor while its being read and then turn it of again. Cant figure out if this is possible on esphome on HA. So anyone done anything similar ?

Using a D1 mini and and YL-69.

1 post - 1 participant

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>