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

Getting Started with Dashboard

$
0
0

So I’ve never used ESPhome and it looks like it might offer a feature I’ve been looking to implement on my mqtt controlled lights that are currently running tasmota.

I fired up an esphome docker and connected to the Dashboard. I was prompted to great my first node.
Going through the process I noticed that there isn’t any lights, or switches, or plugs… Just ESP 8266 and ESP32 boards. Is that expected?

So I picked 8266 generic and used the wizard to great a .yaml file that when I look at it doesn’t seem to have much of anything in it.

esphome:
  name: merkury_white_lights
  platform: ESP8266
  board: esp01_1m

wifi:
  ssid: "Home-SSID"
  password: "PassW0rd"

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Merkury White Lights"
    password: "PassW0rd"

captive_portal:

# Enable logging
logger:

# Enable Home Assistant API
api:
  password: "PassW0rd"

ota:
  password: "PassW0rd"

Is there a guide on how to use the Dashboard?

Does anyone has an example of a basic white light that can be dimmed? I’ve a very visual learner and the chopped incomplete examples on the esphome website is very confusing to me.

3 posts - 3 participants

Read full topic


Do you have an m5stick-c working with current esphome?

$
0
0

I’ve had only partial success working with esphome on my m5stick-c. (I am aware of all the stuff in this thread: Support for AXP192 power management chip?).

I’m using the latest released esphome (1.14.5). Before getting started with my own stuff, I tried using the YAML files from both the water leak sensor project and the generic YAML file from the github repo with the custom component definitions. In both cases, esphome produces an “expects a dictionary” error without pointing to anything specific. That happens with both the dashboard GUI editor and CLI. Since other people have presumably used those files in the past (I mean, it’s not a hoax, is it? :slight_smile:), I wonder if something about the current esphome released version breaks things. Or maybe others have used the esphome beta or dev branches? Beats me (so far). I’ve done a lot of fiddling, but I can only get esphome to accept it by getting rid of all of the sensor: block.

My second problem is that I cannot get anything at all to display on the built-in display. I’ve done some troubleshooting, and I can see that some kind of data is being sent to the display API calls. Since my m5stick-c is recently bought, it has me wondering if maybe some slight hardware change inside it has gummed up the works.

So, anybody have one of these working with the current release of esphome? Any suggestions for things to try?

2 posts - 1 participant

Read full topic

Is there a way to know if MQTT messages have been sent from the device?

$
0
0

I’m using deep sleep for a battery powered esp32 board. When the device wakes up from sleep, I make sure MQTT is connected, and then I force an update from my sensors. I want to put the device back to sleep as soon as possible, but I also don’t want to lose the sensor updates over MQTT. The only reliable way I have found to do it is to delay a short time before calling the deep sleep enable. If I could know when the MQTT messages were cleared out from the esp32, I wouldn’t have to rely on the short delay.

1 post - 1 participant

Read full topic

After updating sonoffs to latest esphome they are unavailable

$
0
0

Im running hassos version 0.112.4 on a pc with esphome firmware version 1.14.5. on sonoff basic r3 In the esphome dashboard they are all online, and I can also see them on my wireless network, but in hassos dashboard they are unavailable.
Their configuations is:
‘esphome:
name: arbejdslys_01
platform: ESP8266
board: esp01_1m’
And the rest according to the template except the wifi settings… (o:
Besides all the network data, the log of one of the sonoffs shows:
‘[12:27:37][C][logger:175]: Logger:
[12:27:37][C][logger:176]: Level: DEBUG
[12:27:37][C][logger:177]: Log Baud Rate: 115200
[12:27:37][C][logger:178]: Hardware UART: UART0
[12:27:37][C][captive_portal:169]: Captive Portal:
[12:27:37][C][ota:029]: Over-The-Air Updates:
[12:27:37][C][ota:030]: Address: carportlys_01.local:8266
[12:27:37][C][api:095]: API Server:
[12:27:37][C][api:096]: Address: carportlys_01.local:6053.’

What can be wrong?

1 post - 1 participant

Read full topic

Deactivate wifi for a certain time

$
0
0

Hi,

I want to make a sleep training-clock for my daughter and want to check 1 or 2 times a day for the hour when the alarm should go off. Because it’s in the bedroom, I want to disable the wifi for the most of the time. The internal clock should stay working so that’s why no deep sleep is wanted.

I tried with following code every

interval:

  • interval: 15s
    then:
    • lambda: |-
      ESP_LOGD(“main”, “Wifi turned off”);
      WiFi.disconnect();
      delay(1000);
      WiFi.mode(WIFI_OFF);
      WiFi.forceSleepBegin();
      delay(100);

This works but every time this happens:

[16:54:59][D][main:205]: Wifi turned off
[16:54:59][W][wifi_esp8266:394]: Event: Disconnected ssid=’’ bssid=B4:FB:E4:91:3D:15 reason=‘Association Leave’
[16:55:00][W][wifi:100]: WiFi Connection lost… Reconnecting…
[16:55:00][W][wifi:495]: Restarting WiFi adapter…
[16:55:00][I][wifi:194]: WiFi Connecting to ‘’…
[16:55:00][W][wifi_esp8266:191]: wifi_apply_hostname_(clock_test): lwIP error -16 on interface st (index 0)

And the wifi connects again.

Has somebody an idea how to tackle this problem? Of where I can look for the solution?

1 post - 1 participant

Read full topic

Light on_turn_on and on_turn_off triggers

$
0
0

Per this pull request, and more specifically this YAML example here triggers for light objects should work, but it doesn’t work for me. I get this when I try to run:

Failed config

light.binary: [source zentec-alt.yaml:23]
  platform: binary
  name: Laundry Light
  id: thelight
  output: relay
  restore_mode: ALWAYS_OFF

  [on_turn_on] is an invalid option for [light.binary]. Please check the indentation.
  on_turn_on:
    - switch.turn_off: redLED

  [on_turn_off] is an invalid option for [light.binary]. Please check the indentation.
  on_turn_off:
    - switch.turn_on: redLED

Here are my yaml files,. I am running the latest esphome 1.14.5. Hopefully I’m just missing something obvious… The only reason I’m trying to do this is because most of the devices I have hooked up to these relays are lights, so I want them to appear as lights in HA.

laundry-light.yaml

substitutions:
  device_name: laundrylight
  friendly_name: Laundry Light
  ip_address: 10.0.2.5
  
<<: !include common.yaml
<<: !include zentec-alt.yaml

zentec-alt.yaml

binary_sensor:
  - platform: gpio
    pin:
      number: GPIO13
      mode: INPUT_PULLUP
      inverted: true
    name: "${friendly_name} Button"
    on_press:
    - light.toggle: thelight
    
status_led:
  pin:
    number: GPIO02
    inverted: true
    
output:
  - platform: gpio
    pin: GPIO12
    id: relay
    

light:
  - platform: binary
    name: "${friendly_name}"
    id: "thelight"
    output: relay
    restore_mode: ALWAYS_OFF
    on_turn_on:
      - switch.turn_off: "redLED"
    on_turn_off:
      - switch.turn_on: "redLED"

switch:
  - platform: gpio
    name: "redLED"
    id: "redLED"
    pin: GPIO4
    inverted: true
    restore_mode: ALWAYS_ON
    internal: true

common.yaml:

esphome:
  name: ${device_name}
  platform: ESP8266
  board: esp01_1m

wifi:
  ssid: 
  password: 
  fast_connect: on #we only have one WiFi AP so just use the first one that matches
  ap: #since we listed an SSID above, this AP mode will only enable if no WiFi connection could be made
    ssid: ${friendly_name}_AP
    password: 
  use_address: ${ip_address}

# Enable logging
logger:
  baud_rate: 0 #disable UART logging since we aren't connected to GPIO1 TXlogger:
#  level: DEBUG

# Enable Home Assistant API
api:

# Enable OTA updates
ota:
  safe_mode: True

# Enable web server
web_server:
  port: 80

1 post - 1 participant

Read full topic

Prevent automatic id creation for esphome devices

$
0
0

Hi, I use esphome for many of my devices and I keep seeing devices being created appended with _1 , _2 _3 in Homeassistant. While this would not have been a problem, it is becoming so as sometimes when HA restarts the old entity is disabled and a new one defined. This breaks all my flows on nodered and lovelace configuraitons. Every now and then I see new entities created and I have go to and fix it in all places.
Can somebody explain to me as to why such entities are created and how can I prevent this?
Thank you.

11 posts - 3 participants

Read full topic

Getting state of cover in ESPHome

$
0
0

Hi everyone, is it possible to get in ESPHome the current state of the cover ?

Not the position, I would like to get whether the cover is moving (closing of opening) or it is stopped.
I tried getting all the states I could think of I used a service to log the states in various situations, from the cover to the switches that move the curtain, but I don’t seem to be able to get anything usable.

My goal is to have a service in ESPHome , available in HA, so that I can mimic a open-stop-close-stop button, so to get this in ESPHome I would need to know what the cover is doing in the service of esphome, but I don’t seem to get anything apart from the position.

Any hints really appreciated

CB

1 post - 1 participant

Read full topic


Esphome A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header

$
0
0

Hi All,

Got my first esp device, tried to flash using both the flasher tool from my windows client and also from hassio addon from my ubuntu server.

I have this device ESP32S.

On the packet the bad english says

  1. When you “make flash”, long press BOOT button
  2. Wait until the connecting…___ stop, then release BOOT button,

I’ve tried this and i cant get it to flash.

Anyone offer any suggestions?

This is the item i purchased fyi: esphome A fatal error occurred: Failed to connect to ESP32: Timed out waiting for packet header

Sam

3 posts - 2 participants

Read full topic

ESP32 WROOM, ESPHOME and I2C port extenders issue

$
0
0

Could anyone give me suggestion with my project issue?
I have ESP32 and I2C extenders (PCF8575) connected to it (0x20 and 0x21 addresses). Connected to two I2C, not master-slave mode.
Using ESPHOME to run it
ESP32 has USB connector, which can power whole 3 “chips”
So, if ESP32 powered with USB - both I2C devices recognized, but only one can communicate with ESP32, for second one ESP32 shows “communication failed”
But, if I power up whole schema with 5V 2A module, both I2C devices not even detected by ESP32, ESP32 works just fine with that power.
Power consumption with USB around 0.14A
Any suggestions?

2 posts - 2 participants

Read full topic

Check from esp side if connected to HA?

$
0
0

Is there a easier/better way to check from esp side if you are connected to HA?

this is what i am using now

class Ha_online : public Component, public Switch {
  public:
    void setup() override {
      // This will be called by App.setup()
    }
    void write_state(bool state) override {
      // This will be called every time the user requests a state change.
      extern char ha_online_state;
      ha_online_state = state;
      // Acknowledge new state by publishing it
      publish_state(state);
    }
};

and then i set the switch to ON in a automation so ON= HA connected.

i use “extern char ha_online_state;” to pass the state between different custom components.

But this only works when esp starts not when it loses connection to ha, esp reboots after 15 min with no ha connection so after 15 min i will know that HA are down or whatever, but i want to know faster then this so i can start “offline” mode in my mixed custom components so i have some functionality when if HA connection are lost
I guess i can change the state of the switch every 30 sec in a HA automation and check this from esp side but i would prefer something smarter, any ideas?

2 posts - 2 participants

Read full topic

Topic_prefix not working fine with ESPHome

$
0
0

Hi, I am kind of out of ideas on why topic_prefix isnt working well for me. I have specified a topic_prefix but I end up seeing messages both on the topic_prefix as well as the default topic , so I end up two set of sensors / switch etc.
Can somebody point out what’s the issue here?

Env: Hassio / ESPHome add on Ver 1.14.5

My ESPHome yaml file:

substitutions:
  # below substitutions are required as they are used in include files
  device_id: 'security_siren'
  device_name: 'Security Siren'
  platform: ESP8266
  board: esp12e
  ssid: !secret secondary_ssid
  ssid_pswd: !secret secondary_ssid_pswd
  mqtt_broker: !secret mqtt_broker
  mqtt_uname: !secret mqtt_uname
  mqtt_pswd: !secret mqtt_pswd
  base_topic: 'home/security/siren'
  api_pswd: !secret api_pswd
  ota_pswd: !secret ota_pswd
  static_ip: 192.168.1.58
  # required substitutions end

  siren_gpio: GPIO12
  led_gpio: GPIO14
  
esphome:
  <<: !include common/esphome.yaml

# Enable logging
logger:

# include the ota & other settings from common file
<<: !include common/common.yaml # cant use common file as I have to define my api below

wifi:
  <<: !include common/wifi.yaml 

api:
  <<: !include common/api.yaml 

mqtt:
#  <<: !include common/mqtt.yaml 
  broker: $mqtt_broker
  username: $mqtt_uname
  password: $mqtt_pswd
  topic_prefix: $base_topic
  reboot_timeout: 10min

# Individual outputs
switch:
  - platform: gpio
    name: "Siren"
    id: "siren"
    icon: mdi:bullhorn
    pin:
      number: $siren_gpio
      mode: OUTPUT
      inverted: False

status_led:
  pin:
    number: $led_gpio
    inverted: yes

text_sensor:
  - <<: !include common/text_sensor/wifiinfo.yaml
  - <<: !include common/text_sensor/mac.yaml
  - <<: !include common/text_sensor/version.yaml

example of one of the included text sensor : wifiinfo.yaml

platform: wifi_info
ip_address:
  name: ${device_name} IP Address
  icon: mdi:ip-network

An image of my MQTT is included, as you can see i have topics created both under the default “homeassistant/” and under what I specific “home/security/siren”. I have deleted the topics multiple times and they keep coming back.

1 post - 1 participant

Read full topic

SI7021 Sonoff sensor wired to esp32

$
0
0

Hey All,

First attempt at using esp32 home. I’ve purchased these boards; https://www.amazon.co.uk/gp/product/B07DQFG46V/ref=ppx_yo_dt_b_asin_title_o01_s00?ie=UTF8&psc=1. (i think i have the board type correct)

flashed them and now up and going over OTA, i’m trying to wire up the Si7021 sensor. It has three wires, white, red and black. I have the White connected to 02, red to 3v3 and black to GND. flashed it with the below config;

esphome:
  name: kitchen
  platform: ESP32
  board: esp32doit-devkit-v1
#  board: nodemcu-32s

wifi:
  ssid: "Home"
  password: "<removed>"

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

captive_portal:

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:

sensor:
  - platform: dht
    pin: 2
    temperature:
      name: "Living Room Temperature"
    humidity:
      name: "Living Room Humidity"
    update_interval: 60s

and is complaining about this;

[21:45:57][W][dht:154]: Waiting for DHT communication to clear failed!
[21:45:57][W][dht:060]: Invalid readings! Please check your wiring (pull-up resistor, pin number) and consider manually specifying the DHT model using the model option.
[21:45:57][D][sensor:092]: ‘Living Room Temperature’: Sending state nan °C with 1 decimals of accuracy
[21:45:57][D][sensor:092]: ‘Living Room Humidity’: Sending state nan % with 0 decimals of accuracy

anyone have any thoughts?

2 posts - 2 participants

Read full topic

Mixing sensors in Custom Component

$
0
0

I’m working on a custom component for a rotary encoder: the M5Stack Faces Encoder. You can both press the knob like a button and turn the know. Actually I have it working with 2 “Sensors”:

  1. Turning the know in- or decreases a value and returns it
  2. Pushing the button returns a 1 when pressed and 0 when released

So far so good. Now I would like to make the button a Binary Sensor. Changed the button to a binary sensor and changed all the integers to bools.

Small parts of the C++ code:

BinarySensor *button_sensor = new BinarySensor();
Sensor *encoder_sensor = new Sensor();

bool button;
int encoder;

Wire.requestFrom(I2C_ADDR_FACESENCODER, 3);

if (Wire.available())
{
    encoder = Wire.read();
    button = Wire.read(); //returns either 0 or 1
}

button_sensor->publish_state(button);
encoder_sensor->publish_state(encoder);

My C++ compiles just fine. The problem is that I don’t know how to add both these sensors to the YAML.

When both were just normal sensors returning a integer I had this:

sensor:
  - platform: custom
    lambda: |-
      auto m5encoder = new M5RotaryEncoder();
      App.register_component(m5encoder);
      return {m5encoder->button_sensor, m5encoder->encoder_sensor};
    sensors:
    - name: ${friendly_name} Button
    - name: ${friendly_name} Encoder

Again, this was working fine until I decided to make the button a binary sensor. I tried a few different YAML configs, but none were working. One of the configs that validates and compiles just fine is this:

sensor:
  - platform: custom
    lambda: |-
      auto m5encoder = new M5RotaryEncoder();
      App.register_component(m5encoder);
      return {m5encoder->encoder_sensor};
    sensors:
    - name: ${friendly_name} Encoder

binary_sensor:
  - platform: custom
    lambda: |-
      auto m5encoder = new M5RotaryEncoder();
      App.register_component(m5encoder);
      return {m5encoder->button_sensor};
    binary_sensors:
    - name: ${friendly_name} Button

Now this clearly does not work as it starts the loop to read the same I2C address twice.

Any idea if it’s possible to mix 2 types of sensors in a single ESPHome component class?

1 post - 1 participant

Read full topic

ESPHome RF Reciever and Transmitter Issue after testing with Arduino Uno and RC-Switch Library

$
0
0

Hello,

I recently picked up a 315Mhz transmitter and receiver. To verify they worked I set them up using an Arduino Uno and the rc-switch library. Both the transmitter and receiver worked really well from both ends of my house using the example scripts from the rc-switch library.

I then set them up with a D1 Mini and ESPHome… and I couldn’t receive a signal unless the remote was extremely close to the antenna (1-2cm away). I have set it up so the receiver so it ran off the D1 Mini and off an independent 5v power supply.

I bought the “LR33B 315MHz ASK Superheterodyne RF Module Wireless Remote Control Receiver Module” from BangGood.

**As a side note: I have a 433Mhz module setup that works fine!

Thank you for any suggestions you can give me.

1 post - 1 participant

Read full topic


Try to Track iBeacons!

$
0
0

Hello!
I just bought myself a SparkFun ESP32 Thing and have been playing with ESPHome.
Very, very cool. Thank you every who contributes to this project.

I want to track bluetooth beacons, I’m going to put one on my Dog’s Collar so that when he’s in the room with the motion sensor, he doesn’t trip it.

But I’ve realiesd the beacons I want to track are iBeacons (they’re XY Find It 3 dongles). Their BT MAC changes all the time, but they always broadcast a consistent UUID.

I currently use a single HappyBubbles to track them, and it works great. I’m hoping to do same with ESPHome.

First of all, I realised the current stable version doesn’t support this. It supports broadcasting of iBeacons, but not tracking them.
So I did some digging and of course I’m not the only one to request this, and in fact I found this lovely PR right here where a great person has already commited the changes!

Sow now I’m running the dev version by following the instructions here and that’s working fine.

This, of course, is where I fall down though!
In Happy Bubbles, the UUID I track look like this: 08885dd0111b11e491910800200c9a66_2406_dc64

The commit above needs a 16, 32 or 128bit UUID. But I have no idea how to find that, or to extract it from the iBeacon UUID I get from Happy Bubbles.

If I try to paste that exact string into my yaml it gives me an error. If I try just putting the first 8 characters in “08885dd0” it accepts it, but of course doesn’t find my beacon.

So yea… I’m a bit stuck! I’m wondering if anyone:

a) Has this working at all (Given it’s dev, it’s unlikely)
b) Knows how to get a 16, 32 or 128bit UUID from what Happy Bubbles sees above.

Many thanks!!

1 post - 1 participant

Read full topic

Differentiate network name from node name

$
0
0

Is it possible to have a device use a different name on the network (DHCP name) than it does in ESPHome (node name)?

Specifically my problem is that ESPHome naming only allows underscores and not hyphens. My DNS server (bind9) only allows hyphens and not underscores!

So now I can’t name my device “garage_smart_light_1”, it has to become something like “garagesmartlight1

5 posts - 3 participants

Read full topic

Home Assistant 0.110.4 & ESPHome

$
0
0

Is there a reason that i cant work out how to get ESPHome as an addon?

I can see it as an integration, but it asks for the node name etc, but i havent got that far yet?
I need the ESPHome to flash the board?
Am i missing something, please help, someone?

Thanks, Dan

Maybe i need to add that i’m running home assistant on unraid using a docker?

1 post - 1 participant

Read full topic

Binary upload using ESPHome

$
0
0

Hello,

Does anyone know if it is possible to upload a non-ESPhome generated binary to an ESP32 using the esphome plugin? The board I am programming unfortunately does not have a USB port so I have to program it OTA or via FTDI and I do not have an appropriate adapter. I am able to program the board OTA using ESPhome but only through the ESPhome interface and I can’t find any “upload binary” menu. Any help is appreciated.

Thanks

3 posts - 2 participants

Read full topic

Device shows Online but can't connect

$
0
0

I have a Wemos D1 Mini with ESPhome on it. The D1 is powered up and connected to my WiFi network (confirmed in my router logs), it also shows as “online” on the ESPhome page in HA. But, the sensor shows as unavailable and the logs in ESPhome show that it can’t connect. I’ve tried rebooting the D1 and HA but that didn’t fix it. Any idea what is wrong?



3

Here is my code

esphome:
  name: kass_noise_sensor
  platform: ESP8266
  board: d1_mini

wifi:
  ssid: "Too Fly For My WiFi"
  password: "xxxxxxxxxx"
  #Static IP
  manual_ip:
    static_ip: 192.168.1.32
    gateway: 192.168.1.1
    subnet: 255.255.255.0
  #Turn Off Power Save Mode
  power_save_mode: none

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Kass Noise Sensor"
    password: "u6S1JwcgHaYd"

captive_portal:

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:

# DEBOUNCED FOR 1S BECAUSE THE TRIGGER PERIOD IS VERY SHORT
binary_sensor:
  - platform: gpio
    pin: D2
    name: "Kass Noise Sensor"
    filters:
      - delayed_off: 20s
      - delayed_on: 2s

5 posts - 3 participants

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>