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

ESPHome: upload to IP directly?

$
0
0

@prankousky wrote:

Hi everybody,

I just flashed ESPHome onto a testing ESP32; I flashed via dev/ttyUSB0, which worked just fine. It also gave me the option to flash over the air (nodemcu32main.local).

I know that nodemcu32main.local) will not be the devices address; it is in a different network than my computer, as I have a VLAN for IOT devices. Also, my router blocks the .local by default.

So I looked at the docs and tried esphome nodemcu_main.yaml run --host-port <ip>; also tried prepending sudo, but it does not make a difference. I get

usage: esphome [-h] [-v] [-q]
               [configuration [configuration ...]] {config,compile,upload,logs,run,clean-mqtt,wizard,mqtt-fingerprint,version,clean,dashboard,vscode,update-all} ...
esphome: error: unrecognized arguments: --host-port <ip>

I tried putting the parameter elsewhere, for example esphome --host-port (...) or esphome nodemcu_main.yaml --host-port (...) etc. etc., even though I was pretty sure that it didn’t matter. Just wanted to see if I could do anything to get this to work.

I ran sudo pip-review --auto, which I have as an alias to upgrade pip; also tried sudo pip install esphome to see whether there was an update. I did not forget pip3 (as stated in the docs) as I am using a distribution that defaults to pip3; so just to be extra sure I tried pip3 instead of pip, without any success…

How can I flash OTA without resorting to the .local? I want my ESPHomes spred around the house, so flashing via USB is not an option. Unfortunately I could not figure this out on my own.

Thank you for your ideas :slight_smile:

Posts: 3

Participants: 3

Read full topic


ESPHOME logger affects Wifi connection?

$
0
0

@minsuke wrote:

I do like ESPHOME things

I have 40 iot things in my router.

but recently, I got a error message which is constanly reconnect

so I changed logger baudrate : 0 and level: None

Before reconnect per 5minutes, After reconnect per 10minutes

I think it affects wifi connection.

Anyone who have same issue with me ?

and who have the solution to make it ?

Posts: 1

Participants: 1

Read full topic

Send toggle state on wake up from deep sleep mode esp32, how to do it?

$
0
0

@slindberg wrote:

Hi :slight_smile:

I´m new to code in esphome, I have got my esp32s up and running and use deep sleep mode, but now I will have it to automatic after it wakes up from deep sleep mode to send toggle state to binary sensor.

Hope your understand what I´m need help to.
Best Regards Stig

my code is here :

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

wifi:
  ssid: "xxxxxx"
  password: "xxxxxx"
  manual_ip:
    # Set this to the IP of the ESP
    static_ip: 192.168.1.75
    # 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
binary_sensor:
  
  - platform: gpio
    name: "25mqttbutton2"
    pin: 
     number: 25
     inverted: False
     mode: INPUT_PULLDOWN
    device_class: 'opening'
    filters:     
      - delayed_off: 1000ms 

# Enable logging
logger:

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

ota:
  password: "xxxxxx"
  
deep_sleep:
    run_duration: 40s
    sleep_duration: 10min
    wakeup_pin: GPIO25
    id: deep_sleep_1


Posts: 2

Participants: 2

Read full topic

Trying to set up a switch that turns on a relay, waits 5 seconds, and turns it off again

Esphome uart.write Action Template: how to convert string to std::vector?

$
0
0

@msmmbl wrote:

Hello, I am working on a screen to show the temperature of PT100 sensor. Follow code read the temperature from pt100 sensor and try to write string like n0.val=25\xff\xff\xff to uart. But I get the error “error: ‘to_string’ is not a member of ‘std’”. I am new to C++. How can I fix it?

        - uart.write: !lambda
            int temp = (int)(id(pt100).state);
            if(temp < 0) temp = 0;
            if(temp > 99) temp = 99;

            std::string str;
            std::string str1 = "n0.val=";
            std::string str2 = "\xff\xff\xff";

            str = str1 + std::to_string(temp) + str2;

            std::vector<uint8_t> vec(str.begin(), str.end());
            return vec;

Posts: 3

Participants: 2

Read full topic

ESPHome smart plug turns off when disconnected from Home Assistant

$
0
0

@Zisla_Taranta wrote:

I’m using ESPHome for a lot of smart plugs in my home. Lately I discovered that some of these plugs turn off when I quit/restart Home Assistant. I’m not sure why they to this. Maybe someone has an idea?

This is an example of the configuration of a smart plug:

substitutions:
  plug_name: avatar_awp08l_1
  
esphome:
  name: ${plug_name}
  platform: ESP8266
  board: esp8285

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

# Enable logging
logger:
  level: ERROR
  
# Enable Home Assistant API
api:

ota:

web_server:
  port: 80

time:
  - platform: homeassistant
    id: homeassistant_time
    
binary_sensor:
  - platform: gpio
    pin:
      number: GPIO13
      inverted: True
    name: "${plug_name}_button"
    on_press:
      - switch.toggle: switch1
  - platform: status
    name: "${plug_name}_status"
    
output:
  - platform: gpio
    pin: GPIO15
    id: relay
  - platform: gpio
    pin: GPIO2
    inverted: True
    id: led1

switch:
  - platform: template
    id: switch1
    icon: mdi:power-socket-eu
    optimistic: true
    name: "${plug_name}_relay"
    turn_on_action:
      - output.turn_on: relay
      - output.turn_on: led1
    turn_off_action:
      - output.turn_off: relay
      - output.turn_off: led1

Posts: 1

Participants: 1

Read full topic

Coffeemachine to turn off after 10 secs if no water, except if pressed on the switch?

$
0
0

@fribse wrote:

Hi All

I’m a bit stumped, and hope you can help me out.
I’ve set up a BlitzWolf SHP-6 to control my coffeemachine, and it’s working very very nicely:

substitutions:
  device_name: coffeemachine

esphome:
  name: '${device_name}'
  platform: ESP8266
  board: esp8285
  on_boot:
    then:
      - switch.turn_on: relay
          
wifi:
  ssid: SSID
  password: WIFIPW
  manual_ip:
    static_ip: 10.11.12.194
    gateway: 10.11.12.1
    subnet: 255.255.255.0
  use_address: 10.11.12.194     
logger:
  baud_rate: 0

api:

ota:
  password: "OTA_PW"

time:
  - platform: homeassistant
    id: homeassistant_time

text_sensor:
  - platform: version
    name: "${device_name} ESPHome Version"
  - platform: wifi_info
    ip_address:
      name: "${device_name} ip"
    ssid:
      name: "${device_name} ssid"

binary_sensor:
  - platform: gpio
    id: button
    internal: true
    pin:
      number: GPIO13
    on_press:
      - switch.toggle: relay

output:
  - platform: gpio
    pin: GPIO00
    inverted: true
    id: led

switch:
  - platform: gpio
    pin: GPIO15
    id: relay
    name: '${device_name} Relay'
    on_turn_on:
      - output.turn_on: led
    on_turn_off:
      - output.turn_off: led

status_led:
  pin:
    number: GPIO02
    inverted: true

sensor:
  - platform: wifi_signal
    name: '${device_name} WiFi Signal'
    update_interval: 60s
    accuracy_decimals: 0
  - platform: uptime
    name: '${device_name} Uptime'
    unit_of_measurement: days
    update_interval: 300s
    accuracy_decimals: 1
    filters:
      - multiply: 0.000011574
  - platform: hlw8012
    sel_pin:
      number: GPIO12
      inverted: true
    cf_pin: GPIO05
    cf1_pin: GPIO14
    current:
      name: '${device_name} Current'
      unit_of_measurement: 'A'
      accuracy_decimals: 3
      icon: mdi:flash-outline
    voltage:
      name: '${device_name} Voltage'
      unit_of_measurement: 'V'
      icon: mdi:flash-outline
    power:
      name: '${device_name} Power'
      unit_of_measurement: 'kW'
      accuracy_decimals: 3
      id: power
      filters:
        - multiply: 0.001
      icon: mdi:flash-outline
    change_mode_every: 4
    update_interval: 10s
  - platform: total_daily_energy
    name: '${device_name} daily energy'
    power_id: power
    unit_of_measurement: 'kWh'

To complement this, I’ve made three automations in HA.
One that turns it on at 6.30
One that turns it off 10s after being turned on, if the powerusage is below 100W (there is no water in it)
One that turns it off after two hours.

I would like to refine it further, so that if you turn it on by pressing the button on the switch, it doesn’t turn off after 10s.

But how do I accomplish this?
My first idea was that I could maybe create an extra binary sensor in the esphome that was set if the button was pressed, and then modify the HA automations to react on that, but then, how do I reset that?
Then I thought about moving the ‘turn off’ logics to be inside the esphome instead of HA automations, that would make it able to reset itself, but how do I then do the timings?

Anybody that has some good ideas?

Posts: 9

Participants: 2

Read full topic

Communication failed?

$
0
0

@Marv wrote:

Hey everyone!
I’m trying to get an ESP8266 with my CSS811 sensor running.

First step was soldering the pins to the board. Then I connected it successfully (or at least I hope so) to the pins D2, D1, the GND and the 3V3.

When I want to start it, this line appears in the logs:

(Message skipped because it was too big to fit in TCP buffer - This is only cosmetic)

as well as

[W][ccs811:124]: Communication failed! Is the sensor connected

Here’s (a part of) the log:

 [18:49:45][I][app:100]: ESPHome version 1.14.3 compiled on Dec 13 2019, 18:48:58
 [18:49:45][C][wifi:415]: WiFi:
 [18:49:45][C][wifi:283]:   SSID: 'MYID'[redacted]
 [18:49:45][C][wifi:284]:   IP Address: MYIP
 [18:49:45][C][wifi:286]:   BSSID: MYBSSID[redacted]
 [18:49:45][C][wifi:287]:   Hostname: 'esp1'
 [18:49:45][C][wifi:291]:   Signal strength: -63 dB ▂▄▆█
 [18:49:45][C][wifi:295]:   Channel: 6
 [18:49:45][C][wifi:296]:   Subnet: 255.255.255.0
 [18:49:45][C][wifi:297]:   Gateway: MYGATEWAY
 [18:49:45][C][wifi:298]:   DNS1: MYDNS1
 [18:49:45][C][wifi:299]:   DNS2: MYDNS2
 [18:49:45][C][i2c:028]: I2C Bus:
 [18:49:45][C][i2c:029]:   SDA Pin: GPIO4
 [18:49:45][C][i2c:030]:   SCL Pin: GPIO5
 [18:49:45][C][i2c:031]:   Frequency: 50000 Hz
 [18:49:45][C][logger:175]: Logger:
 [18:49:45][C][logger:176]:   Level: DEBUG
 [18:49:45][C][logger:177]:   Log Baud Rate: 115200
 [18:49:45][C][logger:178]:   Hardware UART: UART0
 [18:49:45][C][dht:017]: DHT:
 [18:49:45][C][dht:018]:   Pin: GPIO13 (Mode: INPUT)
 [18:49:45][C][dht:024]:   Model: DHT22 (or equivalent)
 [18:49:45][C][dht:027]:   Update Interval: 30.0s
 [18:49:45][C][dht:029]:   Temperature 'Temperature Room'
 [18:49:45][C][dht:029]:     Unit of Measurement: '°C'
 [18:49:45][C][dht:029]:     Accuracy Decimals: 1
 [18:49:45][C][dht:029]:     Icon: 'mdi:thermometer'
 [18:49:45][C][dht:030]:   Humidity 'Humidity Room'
 [18:49:45][C][dht:030]:     Unit of Measurement: '%'
 [18:49:45][C][dht:030]:     Accuracy Decimals: 0
 [18:49:45](Message skipped because it was too big to fit in TCP buffer - This is only cosmetic)
 [18:49:46][C][ccs811:111]: CCS811
 [18:49:46][C][ccs811:112]:   Address: 0x5A
 [18:49:46][C][ccs811:113]:   Update Interval: 30.0s
 [18:49:46][C][ccs811:114]:   CO2 Sensor 'CCS811 eCO2 Value'
 [18:49:46][C][ccs811:114]:     Unit of Measurement: 'ppm'
 [18:49:46][C][ccs811:114]:     Accuracy Decimals: 0
 [18:49:46][C][ccs811:114]:     Icon: 'mdi:periodic-table-co2'
 [18:49:46][C][ccs811:115]:   TVOC Sensor 'CCS811 Total Volatile Organic Compound'
 [18:49:46][C][ccs811:115]:     Unit of Measurement: 'ppb'
 [18:49:46][C][ccs811:115]:     Accuracy Decimals: 0
 [18:49:46][C][ccs811:115]:     Icon: 'mdi:radiator'
 [18:49:46][C][ccs811:119]:   Baseline: NOT SET
 [18:49:46][W][ccs811:124]: Communication failed! Is the sensor connected?
 [18:49:46][C][captive_portal:169]: Captive Portal:
 [18:49:46][C][ota:029]: Over-The-Air Updates:
 [18:49:46][C][ota:030]:   Address: esp1.local:8266
 [18:49:46][C][api:095]: API Server:
 [18:49:46](Message skipped because it was too big to fit in TCP buffer - This is only cosmetic)
 [18:49:48][D][api.connection:583]: Client 'Home Assistant 0.102.2 (192.168.0.13)' connected successfully!
 [18:50:15][D][dht:048]: Got Temperature=22.6°C Humidity=44.7%
 [18:50:15][D][sensor:092]: 'Temperature Room': Sending state 22.60000 °C with 1 decimals of accuracy
 [18:50:15][D][sensor:092]: 'Humidity Room': Sending state 44.70000 % with 0 decimals of accuracy

Does anyone know what to do? Thanks!

Posts: 2

Participants: 2

Read full topic


How does ESPhome / HASS determine that a device is online?

$
0
0

@RGN01 wrote:

I have a perplexing issue - one of my devices (a Sonoff TH10) shows as offline in ESPHome console yet it is online - I can ping it, the sensors are reporting status to HASS and the ‘Show logs’ function works.

Somehow it is getting confused and showing offline image

Thanks.

Richard

Posts: 1

Participants: 1

Read full topic

Errors trying to setup ESP32 in ESPHome

$
0
0

@ygreq wrote:

Hi there!

I am having difficulties trying to setup a ESP NodeMCU (model: esp32-wroom-32).

I chose the first option for ESP32 which is Generic ESP32 WROVER Module

The error I get the first time I try to setup is the following:

Uploading stub…
Running stub…
Stub running…
Changing baud rate to 460800
Changed.
Configuring flash size…
Warning: Could not auto-detect Flash size (FlashID=0xffffff, SizeID=0xff), defaulting to 4MB
Compressed 15872 bytes to 10319…

A fatal error occurred: Timed out waiting for packet content
*** [upload] Error 2
========================= [FAILED] Took 11.69 seconds =========================

Any idea if I should choose something else for this specific ESP32 module? Or what else should I do so I can get it to work.

I have no problems with ESP8266 modules.

Thank you so much!
ygreq

Posts: 3

Participants: 2

Read full topic

Stepper motor ESPHome using global int

$
0
0

@Wayne_Perryman wrote:

Hi All,

I’m trying to work out how to right the code to set the target using a global variable value.

Below is the type of example i want to use but instead of 250 I want the value of a global, I have tried (id(global_var).value) and other things like this with no luck, is anyone able to help?

// Argument is integer (signed int)
// Set the (absolute) target position to 250 steps
id(my_stepper).set_target(250);

Posts: 2

Participants: 1

Read full topic

ESP-01S and GPIO2 - trying to figure out how to indicate that there is voltage on the pin?

$
0
0

@potgieterdl wrote:

Hey All,

Recently got my esp-01s connected to my gate-motor. This is working really well and allows me to open the gate remotely. I have the same sort of setup on my doorbell by the gate, which uses GPIO2 to detect that the doorbell was pressed. Using this i can easily send a notification to telegram (with camera image attached) and then decide what todo (Open, Phone them, speaker, …).

The issue i’m a bit noobish about is that on the gate motor there is a output pin that shows when the gate motor is working (status) that fluctuates between 2.2v (gate moving) to 4.8v (stopped in open position) and then once closed it goes to 0.

I want to know how do i connect this to PIN2 to indicate that something is happening, i dont need the voltage but want to say pin2 “activated” while its moving.

From reading, i can configure it as a sensor, but is i understand correctly attaching more than 3.3v could damage the pin. How would i go about this if at all possible?

Thanks
Derick

Posts: 1

Participants: 1

Read full topic

Programming Teckin SP20 ESPHome without using tuya-convert

$
0
0

@aweiss wrote:

The video and configuration below is for programming SP20 plugs to add to Home Assistant. You can buy these plugs for $10 a piece on Amazon here:

I’ve haven’t yet gotten tuya-convert to work and frankly I enjoy opening these plugs and soldering them. So I just posted a video on how to do it for anyone who’s still uneasy about this. I’m also posting my yaml configuration for programming them with esphome.

Video:

substitutions:
  plug_name: energy_1
  # Higher value gives lower watt readout
  current_res: "0.00221"
  # Lower value gives lower voltage readout
  voltage_div: "955"

esphome:
  name: ${plug_name}
  platform: ESP8266
  board: esp8285

wifi:
  ssid: 'SSIDHERE'
  password: 'PASSWORDHERE'

# Enable logging
logger:


# Enable Home Assistant API
api:
  password: 'PASSWORD'

ota:
  password: 'PASSWORD'

time:
  - platform: homeassistant
    id: homeassistant_time
    
binary_sensor:
  - platform: gpio
    pin:
      number: GPIO13
      inverted: True
    name: "${plug_name}_button"
    on_press:
      then:
        - switch.toggle: "${plug_name}_Relay"
    
switch:
- platform: gpio
  id: "${plug_name}_Relay"
  name: "${plug_name}_Relay"
  pin: GPIO4
  restore_mode: RESTORE_DEFAULT_OFF
  on_turn_on:
    then:
      - switch.turn_on: "${plug_name}_LED_Red"
  on_turn_off:
    then:
      - switch.turn_off: "${plug_name}_LED_Red"          
- platform: gpio
  name: "${plug_name}_LED_Blue"
  pin: GPIO2
  inverted: True
  restore_mode: RESTORE_DEFAULT_OFF
- platform: gpio
  id: "${plug_name}_LED_Red"
  name: "${plug_name}_LED_Red"
  pin: GPIO0
  inverted: True
  restore_mode: RESTORE_DEFAULT_OFF
  
sensor:
  - platform: hlw8012
    sel_pin:
      number: GPIO12
      inverted: True
    cf_pin: GPIO05
    cf1_pin: GPIO14
    current_resistor: ${current_res}
    voltage_divider: ${voltage_div}
    current:
      name: "${plug_name}_Amperage"
      unit_of_measurement: A
    voltage:
      name: "${plug_name}_Voltage"
      unit_of_measurement: V
    power:
      name: "${plug_name}_Wattage"
      unit_of_measurement: W
      id: "${plug_name}_Wattage"
    change_mode_every: 8
    update_interval: 10s
  - platform: total_daily_energy
    name: "${plug_name}_Total Daily Energy"
    power_id: "${plug_name}_Wattage"
    filters:
        # Multiplication factor from W to kW is 0.001
        - multiply: 0.001
    unit_of_measurement: kWh
      
# Extra sensor to keep track of plug uptime
  - platform: uptime
    name: ${plug_name}_Uptime Sensor

Posts: 1

Participants: 1

Read full topic

On Boot Automation Troubles

$
0
0

@weemaaan wrote:

Hi, I have a few smart plugs which have an LED on the button. I want the brightness to change based on sun above/ below horizon. I have this working fine on the sun above/ below horizon trigger but the On Boot automation only ever actions the ELSE condition.

Anyone have any ideas?

substitutions:
  devicename: driveway_lights
  upper_devicename: Driveway Lights

esphome:
  name: $devicename
  platform: ESP8266
  board: esp01_1m
  on_boot:
    then:
      - if:
          condition:
            - sun.is_above_horizon:
          then:
            - light.turn_on:
                id: led
                brightness: 0.75
          else:
            - light.turn_on:
                id: led
                brightness: 0.14
               
sun:
  latitude: #####
  longitude: #####
  on_sunrise:
    - then:
        - light.turn_on:
            id: led
            brightness: 0.75
  on_sunset:
    - then:
        - light.turn_on:
            id: led
            brightness: 0.14
              
wifi:
  ssid: #####
  password: #####
  output_power: 17.5db
  ap:
    ssid: "$upper_devicename Fallback Hotspot"
    password: #####

captive_portal:

logger:

api:

ota:

time:
  - platform: homeassistant

binary_sensor:
  - platform: gpio
    pin:
      number: GPIO13
      mode: INPUT_PULLUP
      inverted: False
    id: sonoff_button
    internal: true
    on_press:
      - light.toggle: light_1
  - platform: status
    name: "$upper_devicename Status"
    id: connected_status

output:
  - platform: gpio
    id: sonoff_relay
    pin:
      number: GPIO5
      
  - platform: esp8266_pwm
    id: basic_blue_led
    pin:
      number: GPIO4
      inverted: true

light:
  - platform: binary
    name: "$upper_devicename"
    id: light_1
    output: sonoff_relay
    
  - platform: monochromatic
    name: "$upper_devicename Blue LED"
    output: basic_blue_led
    id: led
    
switch:
  - platform: restart
    name: "$upper_devicename Restart"

Posts: 2

Participants: 2

Read full topic

DS01 Dimmer configuration?


Esphome pulsed output at interval

$
0
0

@coryms wrote:

Hi all,

I have a garden cooling mist sprayer that needs to be pulsed at intervals. Ideally, i’d like it to present as a switch. When the switch is on, the output is pulsed for 500ms every 20 seconds. When the switch is off - nothing, obviously.

I’d prefer that the actual output is not exposed to to homeassistant, to reduce the risk that the output gets turned on and left like that.

I have the following code, which works, but all the time. I can’t enable and disable the interval timer.

any ideas?

esphome:
  name: mister_minimal
  platform: ESP8266
  board: esp8285

wifi:
  ssid: 'SSID'
  password: 'why you wanna know'

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:

output:
  - platform: gpio
    pin: GPIO16
    id: mister_relay

switch:
  - platform: template
    name: "Mister"
    id: mister_pulse
    turn_on_action:
    - output.turn_on: mister_relay
    - delay: 500ms
    - output.turn_off: mister_relay

interval:
  - interval: 20sec
    then:
      - switch.turn_on: mister_pulse

Posts: 3

Participants: 2

Read full topic

Create an heating only thermostat

$
0
0

@maxim31 wrote:

Hello,

I would like to make a thermostat to control a glycol heating (underfloor heating) I try with esphome to use “bang bang thermostat” but when I import it into home assistant I always get a double thermostat (min and max) but in my case its only heating. I would like the thermostat to work alone if the home assistant had just stopped working.

Otherwise we have a way to make a generic thermostat in home but the temperature setpoint can be modified in home but the esp keeps in memory the last setpoint received

I did something temporary with overheating and freeze security but is not perfect

Thanks all for your help

Esphome code:

esphome:
  name: esp_therm_entree
  platform: ESP8266
  board: nodemcuv2

wifi:
  ssid: "xxxx"
  password: "xxxx"

  # Enable fallback hotspot (captive portal) in case wifi connection fails


captive_portal:

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:

web_server:
  port: 80


dallas:
  - pin: 13
    update_interval: 10s

sensor:
  - platform: dallas
    address: 0xFD0516A1B32BFF28
    name: "Température Planché Entrée"
    id: temp_floor_entree
    on_value_range:
        - above: 29
          then:
            - switch.turn_off: Heating_D3
        - below: 9
          then:
            - switch.turn_on: Heating_D3
    
switch:
  - platform: gpio
    name: "Heating"
    id: "Heating_D3"
    pin: 14
    inverted: false

Configuration.yaml

climate:
  - platform: generic_thermostat
    name: Entrée
    heater: switch.heating
    target_sensor: sensor.temperature_planche_entree
    min_temp: 10
    max_temp: 28    
    target_temp: 23
    cold_tolerance: 0.2
    hot_tolerance: 0.2
    precision: 0.5

Posts: 3

Participants: 2

Read full topic

ESPhome expert - help with simple if condition

$
0
0

@ladaowner wrote:

esphome:
  name: sonos_display_4_lines
  platform: ESP8266
  board: nodemcuv2

wifi:
  ssid: "bertybassett_2Ghz"
  password: "Whatever"

# Enable logging
logger:

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

ota:
  password: "WhatEver"

text_sensor:
  - platform: homeassistant
    id: sonos_volume
    entity_id: sensor.sonos_volume
    internal: true

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

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

  - platform: homeassistant    
    id: sonos_track
    entity_id: sensor.sonos_track
    internal: true
 
  - platform: homeassistant    
    id: sonos_playing
    entity_id: media_player.tv_sonos
    internal: true


i2c:
  sda: D2
  scl: D1

display:
  - platform: lcd_pcf8574
    dimensions: 20x4
    address: 0x27
    id: my_lcd
    lambda: |-
      if XXXXXXXXXX
        id(my_lcd).backlight();
        fflush(stdout);
        it.printf(0, 0, "Volume %s%%", id(sonos_volume).state.c_str());
        it.printf(0, 1, "Artist %s", id(sonos_artist).state.c_str());
        it.printf(0, 2, "Album  %s", id(sonos_album).state.c_str());
        it.printf(0, 3, "Track  %s", id(sonos_track).state.c_str());
      } else { 
        id(my_lcd).no_backlight();
      }

I want to turn on back light only when media_player.tv_sonos = playing. What is the magic if condition that I need to use?

could it be this simple

if sonos_playing = playing

Posts: 1

Participants: 1

Read full topic

Status Change Triggers

$
0
0

@mrrodge wrote:

Hi,

Still yet to try ESPHome however want to go that way. I’m just wondering (looking at using on Sonoff Mini and Shelly 1):

When a physical switch is used with one of these devices, does ESPHome ‘push’ the status change to HA, or does HA periodically ‘pull’ the status from the ESPHome device? The reason I’m asking is because I want a really quick automation fire based on a physical switch linked to a Shelly 1/Sonoff Mini.

I’ve read that Tasmota can be configured to send an MQTT message to mosquitto on status change and was just wondering if ESPHome does anything similar.

I have some TP-Link HS100s and their status doesn’t seem to ‘push’ to HA, it looks like HA periodically ‘pulls’ the status. This means that if I wanted to use the on/off manual switch on the HS100 to trigger an automation, it takes several seconds for HA to see the status change and fire the automation.

Thanks!

Posts: 2

Participants: 2

Read full topic

Node offline, entities unavailable, though OTA works. Manual address, mDNS alternatives

$
0
0

@marshal wrote:

First off, I’ve gotta say ESPHome is amazing. Seriously great work!

Correct me if I’m wrong: It appears that even with a manual IP, mDNS is required for ESPHome to register a node as online. If not registered as online, even though OTA uploading and logging via the ESPHome dashboard continue to work, HA reports entities associated with the node as unavailable.

I seem to be having a problem stemming from a WiFi access point that refuses to pass mDNS (Netgear R7000 in AP mode.) If I set up a node with a manual IP address in my workshop - where my Pi hosting hassio lives, and close to another access point that apparently does well with mDNS (TP-Link AC1750 as AP) - everything works. The ESPHome dashboard shows the node online, and HA actively reports status of associated entities. However this changes when the node is deployed, and connecting to the R7000 AP instead.

In the FAQ I found reference to these alternatives to mDNS:

  • On hass.io add the “status_use_ping=true”
  • On esphome docker dashboard use the env “ESPHOME_DASHBOARD_USE_PING=true”

I’m sure this comes down to my lack of knowledge, but it is unclear to me how to implement these solutions. How do I add “status_use_ping=true” to hass.io? Where in the ESPHome docker dashboard do I use the env “ESPHOME_DASHBOARD_USE_PING=true”?

Edit to add: a node will work in HA when moved to the R7000 AP it at first, even as it is listed as offline in the ESPHome dashboard. It is after a HA restart that the node is listed as “unavailable” in HA.

Posts: 1

Participants: 1

Read full topic

Viewing all 1486 articles
Browse latest View live


Latest Images

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