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

Binary sensor not associated with a pin?

$
0
0

@ashscott wrote:

I have run out of GPIOs on my ESP32 and am using a PCF8574 for some additional output and inputs.

I also need to be able to expose some binary_sensors to HA that aren’t associated with inputs or outputs. A bit like an input_boolean in HA.

Is there a way to do this without adding another PCF8574 and then not using the pins?

I guess I’m simply asking if there is an input_boolean equivalent in ESPHome that can be configured and exposed to HA.

Hope that makes sense.

Posts: 3

Participants: 2

Read full topic


ESPHome new node creation : api.platformio.org connection error

$
0
0

@Dpkpadhy wrote:

Sorry for putting this question. As i have already found many threads on this topic but could not solve it. Completely new to HA.

Newly installed Hassio in Raspberry pi 3B+ board, installed ESPHome as per the guide. Tried to compile the new node created but getting connection error for api.platformio.org.

[API] ConnectionError: HTTPConnectionPool(host=‘api.platformio.org’, port=80): Max retries exceeded with url: /v2/lib/search?query=name%3A%22ESPAsyncTCP-esphome%22 (Caused by NewConnectionError(’<urllib3.connection.HTTPConnection object at 0x75b91f90>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution’,)) (incremented retry: max=5, total=1)
APIRequestError: [API] Could not connect to PlatformIO API Service. Please try later.
"Could not connect to PlatformIO API Service. "

Please help me to guide where it went wrong or any other settings required for this.

Posts: 1

Participants: 1

Read full topic

ESPHOME create a PulseTime like tasmota

$
0
0

@canossa wrote:

Hello, I change my irrigation system from tasmota to esphome, in tasmota I set the PulseTime, just for safety.
Now with esphome I don’t have this possibility?
already appen the irrigation was on all night, just because I update the HA, and the automation was running! :frowning:
I need to put on the code the security in case of fails in HA, Raspberry or Wifi.

This is the code I have now, but it does not work at 100%, since the delay does not reset if I stop and start again the irrigation cicle!

switch:
  - platform: gpio
    id: pin0
    name: "PCF8574 Pin #0"
    pin:
      pcf8574: pcf8574_hub
      number: 0
      mode: OUTPUT
      inverted: False
    on_turn_on:
    - delay: 10s # or whatever max on time you want
    - switch.turn_off: pin0

Thanks

Posts: 1

Participants: 1

Read full topic

Peer to peer

$
0
0

@Giuseppe-P wrote:

Is there a way in esphome to communicate from node to node? Example I press the button of node A and turn on an LED on node B

Posts: 3

Participants: 2

Read full topic

SIM800L - detect ring and RSSI sensor

$
0
0

@InToSSH wrote:

Hi, is it possible to detect the ring and the number of the caller with the integration in ESPHome? I can see the ring with the number in the debug log, but I don’t know if it’s possible to trigger an action with it,
it would be probably enough if I could somehow get the log messages to HA.
Also an RSSI sensor would be nice to show a warning in HA in case the signal gets lost.

Posts: 1

Participants: 1

Read full topic

Esphome: Probe Request Unsuccessful

$
0
0

@myle wrote:

Playing around with a esp8266 nodemcu
I getting “Probe Request Unsuccessful”

[17:07:50][W][wifi:451]: Error while connecting to network.
[17:07:55][D][wifi:304]: Starting scan...
[17:08:01][D][wifi:319]: Found networks:
[17:08:01][I][wifi:365]: - 'MYLE-2' (D8:5D:4C:E5:80:FE) ▂▄▆█
[17:08:01][D][wifi:366]:     Channel: 11
[17:08:01][D][wifi:367]:     RSSI: -65 dB
[17:08:01][D][wifi:369]: - 'MYLE' (18:F1:45:C2:E1:27) ▂▄▆█
[17:08:01][D][wifi:369]: - 'DIRECT-0A-HP MYLE' (F4:39:09:A4:6A:0B) ▂▄▆█
[17:08:01][D][wifi:369]: - '' (00:1F:1F:CB:7E:00) ▂▄▆█
[17:08:01][I][wifi:193]: WiFi Connecting to 'MYLE-2'...
[17:08:07][W][wifi_esp8266:334]: Event: Disconnected ssid='MYLE-2' reason='Probe Request Unsuccessful'
[17:08:07][W][wifi:451]: Error while connecting to network.
[17:08:07][I][wifi:193]: WiFi Connecting to 'MYLE-2'...
[17:08:13][W][wifi_esp8266:334]: Event: Disconnected ssid='MYLE-2' reason='Probe Request Unsuccessful'

have a esp32 and that join the MYLE-2 network OK

Posts: 2

Participants: 2

Read full topic

HA + EspHome = WS2812B stairs project - delay error

$
0
0

@MiZiM wrote:

Hello All,

I’ve combined a small project including HA, EspHome, WS2812B Led strips and Aqara motion sensors to light my 14step stairs. Everything work good except lightning each step that is taking 1second. Cant make it like 400ms. Below is my code, I know it’s chaotic but it works.

My automation:

- id: '15857734476143'
  alias: Sch_down
  description: swiatła dół góra
  trigger:
  - entity_id: binary_sensor.0x00158d0004058359_occupancy
    platform: state
    from: 'off'
    to: 'on'
  condition: 
    - condition: state
      entity_id: input_boolean.notify_schody_up
      state: 'off'
    - condition: state
      entity_id: input_boolean.notify_schody_down
      state: 'off'
    - condition: time
      after: '19:00:00'
      before: '07:00:00'
  action:
  - service: input_boolean.turn_on
    data:
      entity_id: input_boolean.notify_schody_down
  - service: light.turn_on
    entity_id: light.step14
    data:
      brightness: 60
      rgb_color:
      - 120
      - 0
      - 0
  - delay:
      milliseconds: 100
  - service: light.turn_on
    entity_id: light.step13
    data:
      brightness: 60
      rgb_color:
      - 120
      - 0
      - 0
  - delay:
      milliseconds: 100
  - service: light.turn_on
    entity_id: light.step12
    data:
      brightness: 60
      rgb_color:
      - 120
      - 0
      - 0
  - delay:
      milliseconds: 100
  - service: light.turn_on
    entity_id: light.step11
    data:
      brightness: 60
      rgb_color:
      - 120
      - 0
      - 0
  - delay:
      milliseconds: 100
  - service: light.turn_on
    entity_id: light.step10
    data:
      brightness: 60
      rgb_color:
      - 120
      - 0
      - 0
  - delay:
      milliseconds: 100
  - service: light.turn_on
    entity_id: light.step9
    data:
      brightness: 60
      rgb_color:
      - 120
      - 0
      - 0
  - delay:
      milliseconds: 100
  - service: light.turn_on
    entity_id: light.step8
    data:
      brightness: 60
      rgb_color:
      - 120
      - 0
      - 0
  - delay:
      milliseconds: 100
  - service: light.turn_on
    entity_id: light.step7
    data:
      brightness: 60
      rgb_color:
      - 120
      - 0
      - 0
  - delay:
      milliseconds: 100
  - service: light.turn_on
    entity_id: light.step6
    data:
      brightness: 60
      rgb_color:
      - 120
      - 0
      - 0
  - delay:
      milliseconds: 100
  - service: light.turn_on
    entity_id: light.step5
    data:
      brightness: 60
      rgb_color:
      - 120
      - 0
      - 0
  - delay:
      milliseconds: 100
  - service: light.turn_on
    entity_id: light.step4
    data:
      brightness: 60
      rgb_color:
      - 120
      - 0
      - 0
  - delay:
      milliseconds: 100
  - service: light.turn_on
    entity_id: light.step3
    data:
      brightness: 60
      rgb_color:
      - 120
      - 0
      - 0
  - delay:
      milliseconds: 100
  - service: light.turn_on
    entity_id: light.step2
    data:
      brightness: 60
      rgb_color:
      - 120
      - 0
      - 0
  - delay:
      milliseconds: 100
  - service: light.turn_on
    entity_id: light.step1
    data:
      brightness: 60
      rgb_color:
      - 120
      - 0
      - 0

Congiguration on EspHome is making how many leds are on each step.

Posts: 4

Participants: 2

Read full topic

ESPHome Cover.Control - set a relative position

$
0
0

@Klops wrote:

Hello there!

I got several WiFi enabled wall switches i flashed with ESPHome via Tuya-Convert and try to replace built-in switches for the motorized skylights in my flat.

Basically it’s dependant on the cover component. So far so good. I got most of the parts working, but right now i am stuck on the position control. The cover.control allows to call a position to be set. It looks to be an absolute value, but i would like to be able to set a relative position with every button click and can’t wrap my mind about it.

Here is a snippet of code:

cover:
  - platform: time_based
    name: "${devicename} Dachluke"
    id: dachluke
    device_class: window
    open_action:
      - switch.turn_on: relay_1
    open_duration: 10s

    close_action:
      - switch.turn_on: relay_2
    close_duration: 10s

    stop_action:
      - switch.turn_off: relay_1
      - switch.turn_off: relay_2

# my button to be pressed
binary_sensor:
  - platform: gpio
    pin: 
      number: 4
      mode: INPUT_PULLUP
      inverted: True
    id: button_left
    on_multi_click:
    - timing:
        - ON for at most 0.7s
        - OFF for at least 0.5s
      then:
        - cover.control:
            id: dachluke
            position: 25%

Maybe an experienced mind has an idea how to wrap this up with lambdas or so, that would be awesome! =)

Posts: 1

Participants: 1

Read full topic


Tuya Curtain Motor custom component with set position and realtime feedback

How to get new Daikin climate component working?

$
0
0

@michel72 wrote:

Hi,

Since I have a 13 year old Daikin airconditioning, I was happy to see this new component:

Tried it, but the Daikin is not responding. I have these original remotes:

Am I missing something?

substitutions:
  devicename: esp32_ir_rec
  upper_devicename: ESP32 IR receiver

esphome:
  name: $devicename
  platform: ESP32
  board: wemos_d1_mini32

wifi:
  ssid: !secret esphome_wifi_ssid
  password: !secret esphome_wifi_password
  power_save_mode: high
  # enable the fallback hotspot
  ap:
    ssid: $devicename
    password: "qwe12345"

captive_portal:
  
api:
  password: !secret esphome_api_password

ota:
  password: !secret esphome_ota_password
  
web_server:
  port: 80

logger:
  baud_rate: 0
  
#remote_receiver:
#  pin: GPIO18
#  dump: raw

remote_transmitter:
  pin: GPIO18
  carrier_duty_percent: 50%

climate:
  - platform: daikin
    name: "Airco woonkamer"

Posts: 1

Participants: 1

Read full topic

Light.toggle in ESP32 not working properly with momentary button

$
0
0

@Facethewolf wrote:

I have an ESP32 connected to a relay and a momentary button. I want to use the button to turn off the relay locally as well as send a message (somehow) to HAss to turn on/off all lights.
Tap> toggle local relay(light); double tap>all lights on; hold for 2s> all lights off.
BUT—The light.toggle function is not working correctly. It turns off the light, and then IMMEDIATELY turns it back on. I tried to code a toggle from scratch using an if>then>else function, but it still did the same thing. Please Help!

binary_sensor:
  platform: gpio
  pin: 
    number: 12
    mode: INPUT_PULLUP
  name: "BedButton"
  filters: 
   - invert:
   - delayed_on: 50ms
   - delayed_off: 50ms
#   - delayed_on_off: 1000ms
  on_multi_click:
    - timing:
        - ON for at most 1s
        - OFF for at most 0.3s
        - ON for at most 1s
        - OFF for at least 0.2s
      then:
        - light.turn_on: BedLamp1
        - switch.template.publish:
            id: allLights
            state: ON
        - logger.log: "Double-Clicked"
    - timing:
        - ON for at most .5s
        - OFF for at least 0.1s
      then:
        light.toggle: BedLamp1
       # if:
       #   condition:
       #     light.is_on: BedLamp1
       #   then:
       #     - light.turn_off: BedLamp1
       #     - logger.log: "Single-Clicked Off"
         # else: 
         #   - light.turn_on: BedLamp1
         #   - logger.log: "Single-Clicked On"
    - timing:
        - ON for at least 2s
      then:
        - light.turn_on:
            id: ButtonLight
            brightness: 15%
        - switch.template.publish:
            id: allLights
            state: OFF
        - logger.log: "Hold-Click"

Posts: 1

Participants: 1

Read full topic

Help turnin on a switch twice a day

$
0
0

@luciandf wrote:

Hello all,

I am attempting my first automation: a plan watering system using a small submersible pump, a relay, an ESP32 WEMOS LOLIN32 (I think it is called this way) and a water level sensor (when the water is above the sensor it stays horizontal and when it goes below it tilts and breaks a connection).

I have managed using the following yaml configuration loaded on the ESP32 to create a switch that when I trigger it manually, stays open for a number of seconds and then turns itself off if the binary sensor is off and it will only turn on for a very short amount of time if the sensor is on:

binary_sensor:
  - platform: gpio
    pin: 
      number: 21
      mode: INPUT_PULLUP
    name: "Level Sensor"
    id: lvldn

switch:
  - platform: gpio
    pin: 26
    name: "Pump Switch"
    id: ps
    on_turn_on:
      then:
        if:
            condition:
              binary_sensor.is_on: lvldn
            then:
              - switch.turn_on: ps
              - delay: 500ms
              - switch.turn_off: ps
            else:
                if:
                  condition:
                    binary_sensor.is_off: lvldn
                  then:
                    - switch.turn_on: ps
                    - delay: 10s
                    - switch.turn_off: ps

What I would like to do from here is the following:

  1. is there a way to avoid turning on the pump for a short while when the sensor state is on?

  2. instead of manually turning on the pump like I do now for testing I would like to have the pump turn on once in the morning (say at 6 am) for 10 mins and once in the evening at 8 pm (for 10 mins) every day and only if the water level sensor is in the off position. If the sensor is on the ideally I would like the pump to not turn on at all (I place the water level sensor in the tank so that the pump will not run on empty but it is better to not turn it on at all if possible) and maybe send me a notification somehow through the HA interface.

Can anyone help a complete beginner with automations?

Cheers,

Lucian

Posts: 1

Participants: 1

Read full topic

ADC to binary swtich

$
0
0

@ageurtse wrote:

i’m trying to hook up some reed contact that are build in my home.
They came with resistors in it, so i hooked them up to a esp32 and read there analoge value.

now i need to turn on / off a swtich at certain value.

in the log’s it seems to work, but the switch isn’t changing its state in lovelace.
what can i do to see the changes in lovelace.

Next i wan’t to automate my heating, if a door or window is opend longer than x minutes, the heating should be turned off.

here is the config from esphome:

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

wifi:
  ssid: "##########"
  password: "#######"

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

captive_portal:

# Enable logging
logger:

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

ota:
  password: "#########"

switch:
  - platform: template
    name: "Raam achter"
    id: raamachter

  - platform: template
    name: "Raam voor"
    id: raamvoor

  - platform: template
    name: "Achter deur"
    id: achterdeur

  - platform: template
    name: "Voor deur"
    id: voordeur


sensor:
  - platform: adc
    pin: GPIO36  
    name: "Raam voor"     #ingang 1
    attenuation: 11db
    update_interval: 5s
    on_value_range:
      - above: 2.1
        then:
          - switch.turn_on: raamvoor
      - below: 2.0
        then:
          - switch.turn_off: raamvoor
  
  - platform: adc
    pin: GPIO39  
    name: "Raam achter"    #ingang 2 
    update_interval: 5s
    attenuation: 11db
    on_value_range:
      - above: 2.1
        then:
          - switch.turn_on: raamachter
      - below: 2.0
        then:
          - switch.turn_off: raamachter
  
  - platform: adc
    pin: GPIO34  
    name: "Achterdeur"     #ingang 3
    update_interval: 5s
    attenuation: 11db
    on_value_range:
      - above: 2.1
        then:
          - switch.turn_on: achterdeur
      - below: 2.0
        then:
          - switch.turn_off: achterdeur
  
  - platform: adc
    pin: GPIO35 
    name: "Voordeur"      #ingang 4
    update_interval: 5s
    attenuation: 11db
    on_value_range:
      - above: 2.1
        then:
          - switch.turn_on: voordeur
      - below: 2.0
        then:
          - switch.turn_off: voordeur

Posts: 1

Participants: 1

Read full topic

Automatic sanitizer using esphome + nodemcu + ultrasonic sensor

$
0
0

@bpmittal wrote:

I want to make a automatic sanitizer using esphome + nodemcu + ultrasonic sensor + sprayer with motor ,
i have successfully integrated all these items and started it and it is working but there is some problem ,

sometime when the device is restarted or switched off and on , then
the sprayer starts automatically and it does not stops ,
and
sometime the ultrasonic sensor starts to work reverse ,

please help

esphome:
  name: sanitizer_node
  platform: ESP8266
  board: nodemcuv2
  
wifi:
  networks:

    
  # Optional manual IP
  manual_ip:


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

# Enable logging
logger:

# Enable Home Assistant API
api:
  password: 

ota:
  password:
  
web_server:
  port: 80  

sensor:
  - platform: ultrasonic
    id: ultrasonic_sensor
    trigger_pin: GPIO4
    echo_pin: GPIO5
    name: "Sanitizer Sensor"
    update_interval: 1s
    filters:
      filter_out: nan
    timeout: 3m    

switch:
- platform: gpio
  pin: 
    number: GPIO14
    inverted: yes
  restore_mode: always off
  name: "Sanitizer Botton"
  id: relay1
    
binary_sensor:
    
  - platform: template
    name: "Sanitizer"
    device_class: presence
#    filters:
#      - invert:
#      - delayed_on: 100ms
#      - delayed_off: 100ms
#      - delayed_on_off: 100ms    
    lambda: |-
      if (id(ultrasonic_sensor).state < 0.9) {
        // car is in the garage
        return true;
      } else {
        // no car
        return false;
      }     
    on_state:
      then:
        - switch.toggle: relay1  


Posts: 1

Participants: 1

Read full topic

ESPHome with/without WiFi

$
0
0

@rak wrote:

Hello,

I am planning to have an RV setup with home assistant. Basic functions should run without the rPi running. I have planned to use ESPHome and a NodeMCU for those basic functions. Turning on the water pump and some lights. I have small switches and some relais connected to the ESP. Works like a charm. When the rPi is on he connects via MQTT to home assistant.

Now I want the ESPHome to run even without Wifi being present. I would like to be able to save as much power (Turn the router off) and still being able to turn the light on/off.

When connected to Wifi everything works like a charm. When I turn the router off I see the ESP trying to connect to wifi constantly. And the application on the ESP seems not to work any longer.

[20:25:55][W][wifi:374]: No matching network found!
[20:26:00][D][wifi:304]: Starting scan...
[20:26:02][D][wifi:319]: Found networks:
[20:26:02][D][wifi:369]: - 'kabellos_internal'[redacted] (04:62:73:36:A4:78) [redacted]▂▄▆█
[20:26:02][D][wifi:369]: - 'kabellos'[redacted] (04:62:73:36:A4:79) [redacted]▂▄▆█
[20:26:02][D][wifi:369]: - 'kabellos_guest'[redacted] (04:62:73:36:A4:7A) [redacted]▂▄▆█
[20:26:02][D][wifi:369]: - 'kabellos_iot'[redacted] (04:62:73:36:A4:7B) [redacted]▂▄▆█
[20:26:02][D][wifi:369]: - 'Robonect Hx+'[redacted] (DE:4F:22:D1:93:71) [redacted]▂▄▆█
[20:26:03][D][wifi:369]: - 'keinkabel_speed'[redacted] (34:31:C4:10:9D:32) [redacted]▂▄▆█
[20:26:03][D][wifi:369]: - 'kabellos'[redacted] (D8:67:D9:C3:0F:11) [redacted]▂▄▆█
[20:26:03][D][wifi:369]: - 'kabellos_iot'[redacted] (D8:67:D9:C3:0F:13) [redacted]▂▄▆█
[20:26:03][D][wifi:369]: - 'kabellos_internal'[redacted] (D8:67:D9:C3:0F:10) [redacted]▂▄▆█
[20:26:03][D][wifi:369]: - 'kabellos_guest'[redacted] (D8:67:D9:C3:0F:12) [redacted]▂▄▆█
[20:26:03][D][wifi:369]: - 'EasyBox-065722'[redacted] (E0:51:63:06:57:80) [redacted]▂▄▆█
[20:26:03][W][wifi:374]: No matching network found!
...

This is the Wifi section I have.

wifi:
  ssid: !secret wifi_ssid_emil
  password: !secret wifi_password_emil
  fast_connect: false
  ap:
    ssid: !secret wifi_fallback_ssid
    password: !secret wifi_fallback_password
  manual_ip:
    static_ip: 192.168.1.205
    gateway: 192.168.1.1
    subnet: 192.168.1.1
    dns1: 8.8.8.8
    dns2: 4.4.4.4
  reboot_timeout: 0s

When I turn Wifi completely off in the ESP.yaml the application works smooth again.

I resetting the Wifi causing the trouble? Can I prevent this from happening?

Can someone point me into the right direction?

Regards
Ralf

Posts: 1

Participants: 1

Read full topic


Meteorological visibility from a sensor?

$
0
0

@SpikeyGG wrote:

I really like being able to build stuff with ESPHome and esp8266 devices. Now that DarkSky was bought by Apple, I need to look at building a weather station so I can collect my own data. However, one of the most valuable pieces of data that DarkSky gives me is a visibility value, the number of miles you can see or how clear the day is. It varies a lot in my area because of fog. I’m wondering if there’s some way to use sensors with an esp8266 to gather this data automatically.

Anyone know?

Posts: 1

Participants: 1

Read full topic

Flashing devices for other people

$
0
0

@jms3000 wrote:

I want to flash a device with ESPhome, but it is not for me and I don’t know the wifi name and pw.
Is there a way to flash without wifi data and the receiving person can connect to an AP and enter the wifi data into a web page? (provisioning)

Posts: 2

Participants: 2

Read full topic

How to set ESPHome on_time using HA?

$
0
0

@ashscott wrote:

I need to be able to set the hours and minutes in and ESPHome on-time automation from HA.

When I try this…

sensor:

  - platform: homeassistant
    name: "Heating on time 1 hours"
    entity_id: sensor.heating_on_time_1_hours
    id: heating_on_time_hours

  - platform: homeassistant
    name: "Heating on time 1 minutes"
    entity_id: sensor.heating_on_time_1_minutes
    id: heating_on_time_minutes

time:
  - platform: homeassistant
    id: homeassistant_time
    # timezone: Europe//London
    on_time:
      - minutes: !lambda 'return id(heating_on_time_1_minutes).state;'
        hours: !lambda 'return id(heating_on_time_1_hours).state;'
        then:
          - switch.turn_on: boiler

…I get a validation error:

  on_time: 
    - [source /config/esphome/heating_controller.yaml:171]
      
      This option is not templatable!.
      minutes: !lambda |-
        return id(heating_on_time_1_minutes).state; [source /config/esphome/heating_controller.yaml:171]

Is there a way to do this?

I’d like to keep the automation solely on the ESPHome device rather than control it from HA.

Additionally, I still can’t get my ESPHome time to be the same as HA. It’s one hour behind.

Any ideas?

Posts: 1

Participants: 1

Read full topic

Soil hygrometer help

$
0
0

@dirtdiver1977 wrote:

I’m using a cheap resistive soil hygrometer from ebay with my esp32 currently. I’m trying to “port” the code that i’m using over. Can someone help please.

// Read Soil Moisture
    float asoilmoist=analogRead(32);                                                              // Replace 32 with pin you are using
    float asoilmoist1;
    asoilmoist=0.95*asoilmoist+0.05*analogRead(32);                                               // Replace 32 with pin you are using
    asoilmoist1=map(asoilmoist,0,2400,0,100);

Posts: 2

Participants: 2

Read full topic

Compatability

Viewing all 1486 articles
Browse latest View live


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