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

Bang_bang climate dont work esphome

$
0
0

@Javier_Gomez wrote:

hello
I have a dallas sensor with a climate bang-band control.
It shows the temperature but does not deactivate the relay.
I don’t know if I have to put something else in the code
This is the code that I have
Thank you

climate:
  - platform: bang_bang
    sensor: $Id_Sensor_01
    id: $Id_Calefaccion_01
    name: $Nombre_Calefaccion_01
    visual:
      min_temperature: 12 °C
      max_temperature: 25 °C
      temperature_step: 0.1 °C
    default_target_temperature_low: 12 °C
    default_target_temperature_high: 22 °C
    heat_action:
      - switch.turn_on: $Id_Salida_Calefaccion_01
    idle_action:
      - switch.turn_off: $Id_Salida_Calefaccion_01

Posts: 3

Participants: 2

Read full topic


Best approach to a simple battery powered LED light

$
0
0

@ideal2545 wrote:

Hi All,

So I have this need to stick some sort of LED next to my external doors that shows alarm state, red if armed, green if not armed. I want it to be very small but also battery powered so I can easily put this ‘status light’ somewhere. I was curious if anyone had any suggestions to do this using ESPHome? I’ve only ever used NodeMCU ESP8266’s and Sonoff S31’s with ESP home but I know there are much smaller boards and I know that LED’s dont take much power so i’m hoping it could be wired up with just a triple A battery or even CR2032’s that last a long time.

Posts: 2

Participants: 2

Read full topic

Get the state of a pin (HIGH or LOW)

$
0
0

@anjoze wrote:

Hi. I’m trying to do a basic thing from Arduino that I’m getting some complications here.
As you can see in the picture, I have a tank with a reed switch on a floater to know when the water is on that level so it will activate a water pump x seconds.

Tank|690x452

What I want is something like:
while (pin x is high)
relay stays ON

I’ve tried this code:

switch:
  - platform: gpio!
    pin: GPIO4
    name: "Reley"
    id: pump_reley

binary_sensor:
  - platform: gpio
    name: "Floater"
    pin:
      number: GPIO5
      mode: INPUT_PULLUP
    on_press: ()
      then:
        - switch.turn_on: pump_reley
        - delay: 50s
        - switch.turn_off: pump_reley

There are multiple problems with this logic.
1- If the reed switch is pressed, and stay pressed, the action is not done until I “unpress” it.
2- If the water still above the switch limit and the time (50s) is over, it will not do the action again.

I was trying the while, if, wait until, etc, without success :frowning:
Thank you for any help.

Posts: 3

Participants: 2

Read full topic

ESP rotary dimmer

$
0
0

@19roland70 wrote:

I’m trying to make a dimmer with an esp and a rotary encoder.
Does anyone give me an hint.
I have a Rotary Encoder

sensor:
  - platform: rotary_encoder
    name: "Rotary Encoder"
    pin_a: D1
    pin_b: D2
    min_value: 0
    max_value: 100
    resolution: 2

and

light:
  - platform: monochromatic
    name: "Ceiling light"
    output: output_component1
output:
  - platform: esp8266_pwm
    id: output_component1
    pin: D6

Invidually is this working but I want to dim the lights with the rotary-encoder but how must I program this in the ESP?
The next step is that I want create 1 input for connect an zero cross detection like the schematic below.

Posts: 1

Participants: 1

Read full topic

How to add three channels of pzem 004t v3

$
0
0

@boyyao wrote:

Try the following code:

# Enable logging
logger:
  level: NONE
  hardware_uart: UART1

web_server:

# Enable Home Assistant API
api:
  password: $api_password
  reboot_timeout: $api_reboot_timeout

ota:
  password: $ota_password

sensor:                               #传感器
  - platform: pzemac
    current:
      name: "CH_1 Current"
    voltage:
      name: "CH_1 Voltage"
    power:
      name: "CH_1 Power"
    frequency:
      name: "CH_1 Frequency"
    power_factor:
      name: "CH_1 Power Factor"
    update_interval: 5s
    address: 1

  - platform: pzemac
    current:
      name: "CH_2 Current"
    voltage:
      name: "CH_2 Voltage"
    power:
      name: "CH_2 Power"
    frequency:
      name: "CH_2 Frequency"
    power_factor:
      name: "CH_2 Power Factor"
    update_interval: 5s
    address: 2

  - platform: pzemac
    current:
      name: "CH_3 Current"
    voltage:
      name: "CH_3 Voltage"
    power:
      name: "CH_3 Power"
    frequency:
      name: "CH_3 Frequency"
    power_factor:
      name: "CH_3 Power Factor"
    update_interval: 5s
    address: 3   

uart:
 - id: pzem004t1
   rx_pin: 3
   tx_pin: 1
   baud_rate: 9600
   stop_bits: 2

But I can’t get any information

ESP 01s is used

Tasmota was used before

Set module address with moduleaddress 1 / 2 / 3

Posts: 5

Participants: 2

Read full topic

How to report pulse width of laser only when triggered?

$
0
0

@dave_sausages wrote:

Hi all,

Been scratching my head with this one for a while, and it’s time to ask for help.

Put simply, I’ve got an ESP8266 with a laser receiver board connected, and I’ve got the pulse width sensor component reading it in ESPHome and reporting to HA fine.

The problem is: I have a custom flat laser beam remote that has two different PWM’s (10ms and 50ms, both with 50% duty cycle) and I want ESPhome to report what the PWM of the laser beam that just passed over it was. At the moment, if the 10ms laser passes over the sensor, the ESPHome node waits until the interval time (up to 60s at the moment) and then tells HA that value. AND it reports that exact same value every 60s for the rest of time.

I would like this node to only send the pulse width of the last laser beam it saw, and only report instantly after it happens. So if I shine the 10ms pulse at it, it tells HA it saw the 10ms pulse, and if 10 minutes later I shine the same 10ms pulse at it, it does the same thing again. And if 30 minutes later I shine the 50ms pulse at it, it reports it just saw the 50ms pulse.

Here’s the very basic code I’ve got so far:

sensor:
  - platform: pulse_width
    pin: D1
    name: Pulse Width Sensor


Posts: 1

Participants: 1

Read full topic

ESP home esp32, DHT sensors dropping out

$
0
0

@Theamateur wrote:

Hello.
I’ve tried a few, but I think I need a pointer now.
I’ve got 3 esp32 running 2 x Dht22 (am2302) each, and 2 relays.
It all was working for a few hour, and then sensors dropped out… Not aways the same sensor missing… Suddenly I had just reading from 2-3 sensors

I’ve tried adding pullup resistor at the sensor end (never had issues with other sensors around the house)
I used first cat6 cables, changed to better cable 1,5mm (thick for this I think, but ok)
Still no luck. Tried giving id to each sensor. Kinda starting to wonder if some pins om my esp32 wroom 32, don’t like dht? Can’t find the page, but I recall seeing a page sometime about some pins are better and some aren’t better suited for some connections🤔

Code in ESP Home:
esphome:
  name: leviatan
  platform: ESP32
  board: esp-wrover-kit

wifi:
  ssid: "redacted"
  password: "redacted"

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

captive_portal:

# Enable logging
logger:

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

ota:
  password: "redacted"

sensor:
  - platform: dht
    model: AM2302
    pin: 22
    temperature:
      name: "leviatan hot"
    humidity:
      name: "leviatan hot1"
    update_interval: 60s
  - platform: dht
    model: AM2302
    pin: 5
    temperature:
      name: "leviatan cold"
    humidity:
      name: "leviatan cold1"
    update_interval: 60s
    
switch:
  - platform: gpio
    pin: GPIO27
    name: "Relay #1"
  - platform: gpio
    pin: GPIO12
```code

Posts: 2

Participants: 1

Read full topic

Climate esphome


Switch on in condition

$
0
0

@Ilmisu wrote:

Hi guys, I need to pull up a switch after a branch of and conditions, else switch off. I couldn’t write it right.
could somebody help me with sintax?
I write it as:

binary_sensor:
  - platform: gpio
    pin:
     number: D1
     mode: INPUT_PULLUP
    name: "Porta Ingresso"
    id: porta_ingresso
    device_class: door
    
  
  - platform: gpio
    pin:
     number: D2
     mode: INPUT_PULLUP
    name: "Finestra Soggiorno"
    id: porta_soggiorno
    device_class: window
    
  - platform: gpio
    pin:
     number: D5
     mode: INPUT_PULLUP
    name: "Finestra Cucina"
    id: finestra_cucina
    device_class: window
    
  - platform: gpio
    pin: 
     number: D6
     mode: INPUT_PULLUP
    name: "Finestra Camera"
    id: finestra_camera
    device_class: window
    
  - platform: gpio
    pin: 
     number: D7
     mode: INPUT_PULLUP
    name: "Finestra Bagno"
    id: finestra_bagno
    device_class: window
    
 
 
output:
  - platform: gpio
    pin: D3
    inverted: True
    id: 'inserimento_parziale'

  - platform: gpio
    pin: D4
    inverted: True
    id: 'perimetrale_soggiorno'
      
  - platform: gpio
    pin: GPIO1
    inverted: True
    id: 'disinserimento_antifurto'
  
  
    
switch:
  - platform: output
    name: "Inserimento Parziale"
    output: 'inserimento_parziale'
   
  - platform: output
    name: "Perimetrale Soggiorno"
    output: 'perimetrale_soggiorno'
    
  - platform: output
    name: "Disinserimento Antifurto"
    output: 'disinserimento_antifurto'

  - platform: gpio
    pin: D4
    id: perimetrale_soggiorno_ok

#automazione perimetrale soggiorno#

esphome.on_loop:
  then:
    if:
      condition:
        and:
          - binary_sensor.is_on: porta_ingresso
          - binary_sensor.is_on: finestra_cucina
      then:
        - switch.turn_on: perimetrale_soggiorno_ok

but i get this on validate:

INFO Reading configuration /config/esphome/test.yaml...
ERROR Unexpected exception while reading configuration:
Traceback (most recent call last):
  File "/usr/local/bin/esphome", line 11, in <module>
    load_entry_point('esphome', 'console_scripts', 'esphome')()
  File "/opt/esphome/esphome/__main__.py", line 566, in main
    return run_esphome(sys.argv)
  File "/opt/esphome/esphome/__main__.py", line 544, in run_esphome
    config = read_config()
  File "/opt/esphome/esphome/config.py", line 808, in read_config
    res = load_config()
  File "/opt/esphome/esphome/config.py", line 668, in load_config
    return _load_config()
  File "/opt/esphome/esphome/config.py", line 656, in _load_config
    result = validate_config(config)
  File "/opt/esphome/esphome/config.py", line 440, in validate_config
    component = get_component(domain)
  File "/opt/esphome/esphome/config.py", line 171, in get_component
    assert '.' not in domain
AssertionError

please hep me…thanks a lot.

Posts: 1

Participants: 1

Read full topic

ESPHome and TSL2581 sensor

Can I flash Wifi plug with ESPhome without flashing Tasmota first?

$
0
0

@boneheadfraggle wrote:

I have a couple of Tuya (Nedis) outdoor wifi plugs. I flashed the first one with tasmota, the migrated to ESPhome.
But for the other one, I thought I could go straight to ESPhome. But I can’t find any information on the “setting up a temporary AP, reset the plug and enter config mode”.

So, is it possible to flash an out-of-the box plug with ESPhome firmware without going via tuya-convert?

Posts: 4

Participants: 2

Read full topic

ESPHome Time-based cover at boot

$
0
0

@gt4020 wrote:

Hi all,
i’m using time-based cover esphome integration on a wemos d1 mini. It is working but i noticed that at wemos reboot cover position always starts at 50%, so the sync with real position is lost. I’m tryng to use globals to store cover position but i can’t get it working. It always start at 50% at reboot. Where i’m wrong?
Below my related code…
I’m sorry but i’m new to esphome

esphome:
  name: tapparelle_zona_giorno
  platform: ESP8266
  board: d1_mini
  on_boot:
    priority: -10
    # ...
    then:
      - lambda: |-
          id(my_cover_1).publish_state(my_cover_1_global);
          id(my_cover_2).publish_state(my_cover_2_global);
globals:
  - id: my_cover_1_global
    type: float
    restore_value: yes
#    initial_value: '0'
  - id: my_cover_2_global
    type: float
    restore_value: yes
#    initial_value: '0'
cover:
- platform: time_based
  name: "Tapparella 1"
  id: my_cover_1
  open_action:
    - switch.turn_on: on_cover_1
    - globals.set:
          id: my_cover_1_global
          value: !lambda |-
            return id(my_cover_1).position;
  open_duration: 24s
  close_action:
    - switch.turn_on: on_cover_1
    - switch.turn_on: dir_cover_1
    - globals.set:
          id: my_cover_1_global
          value: !lambda |-
            return id(my_cover_1).position;
  close_duration: 22s
  stop_action:
    - switch.turn_off: on_cover_1
    - switch.turn_off: dir_cover_1
    - globals.set:
          id: my_cover_1_global
          value: !lambda |-
            return id(my_cover_1).position;
    
- platform: time_based
  name: "Tapparella 2"
  id: my_cover_2
  open_action:
    - switch.turn_on: on_cover_2
    - globals.set:
          id: my_cover_2_global
          value: !lambda |-
            return id(my_cover_2).position;
  open_duration: 24s
  close_action:
    - switch.turn_on: on_cover_2
    - switch.turn_on: dir_cover_2
    - globals.set:
          id: my_cover_2_global
          value: !lambda |-
            return id(my_cover_2).position;
  close_duration: 22s
  stop_action:
    - switch.turn_off: on_cover_2
    - switch.turn_off: dir_cover_2
    - globals.set:
          id: my_cover_2_global
          value: !lambda |-
            return id(my_cover_2).position;

Posts: 3

Participants: 3

Read full topic

Binary Sensor and switch on the same pin

$
0
0

@Bimmer wrote:

I have a dehumidifier that I want to control from Home Assistant while still being able to use the buttons. For instance if I turn it on/off it should show on/off in Home Assistant and vice versa. I soldered two leads to the button and hooked it up to my d1 mini

This is what I currently have down:

switch:
  - platform: gpio
    pin: D5
    name: "Living Room Dehumidifier"
    id: dehumidifier1
    
binary_sensor:
  - platform: gpio
    name: "Living Room Dehumidifier"
    pin: 
      number: D5
      mode: INPUT_PULLUP
    on_press:
      - then:
        - switch.turn_on: dehumidifier1
      - then:
        - switch.turn_off: dehumidifier1


Unfortunately, I know what I put wrote in esphome isn’t correct. what would be the best way to go about this?

Posts: 6

Participants: 5

Read full topic

How many components can be created in one ESPHOME?

Click count

$
0
0

@11153 wrote:

Hi!! I have a button on pin 8. How I can count of click? I want count on esp32 and load info in home assistant.

Posts: 3

Participants: 2

Read full topic


Need Help setting up deepsleep.prevent

$
0
0

@mbt wrote:

Hello Everyone
I am trying to prevent deepsleep from a sensor.
But when I publish the code on hassio for preventing the deepsleep while the sensor is sleeping, it doesn’t get the message when it wakes up. It only works when I publish it while it is awake.

Any idea how to get it to update the message on wakeup?

this is the code

esphome:
  name: niveau_cuve
  platform: ESP8266
  board: d1_mini_pro


wifi:
  ssid: "mySSID"
  password: "mypass"
  manual_ip:
    static_ip: 192.168.XX.XX (hidden on purpose)
    gateway: 192.168.XX.XX (hidden on purpose)
    subnet: 255.255.255.0


captive_portal:

# Enable logging
logger:

# Enable Home Assistant API

ota:

mqtt:
  broker: 192.168.68.150
  username: Myuser
  password: MyPass
  discovery: true
  discovery_retain: true
  birth_message:
    topic: niveau_cuve/topic
    payload: online
  will_message:
    topic: niveau_cuve/topic
    payload: offline
  on_message:
    - topic: niveau_cuve/ota_mode
      payload: 'ON'
      then:
        - deep_sleep.prevent: deep_sleep_1
    - topic: niveau_cuve/ota_mode
      payload: 'OFF'
      then:
        - deep_sleep.enter: deep_sleep_1
sensor:
  - platform: ultrasonic
    trigger_pin: D1
    echo_pin: D2
    name: "Ultrasonic Sensor"
    update_interval: 10s
    filters:
      - filter_out: nan
  
switch:
  - platform: restart
    name: "niveau_cuve"

deep_sleep:
  id: deep_sleep_1
  run_duration: 1min
  sleep_duration: 10h`

Posts: 5

Participants: 2

Read full topic

Retain switch states on a power failure

$
0
0

@rishabmehta7 wrote:

Hi Guys,

So i have ESPHome running on SonOff switches. They use MQTT for communication.
ESPHome was much easier then Tasmota for me.
One issue is when we loose power (that happens more often in India then guys in the west), all my devices default to OFF. (Except devices running stock sonoff devices). This is a problem as say during the night if the fan is on before the power cut, it just stays off even after the power is back and a serious blocker in ‘wife acceptance’.
Just to clarify all my switches and my HassIO reboot. So is there a way out?

Rishab

Posts: 5

Participants: 2

Read full topic

Implementing custom Nexa 433mhz component with Homeeasy library

$
0
0

@Ubiquitous-X wrote:

I am having lots of trouble with getting remote transmitter and reciever (rc_switch) to work with my Nexa wireless relays (EYCR-2300), using those RF Transmitter Reciever cheap modules. The readings from the remote (NEYCT-705) is unreliable and I just haven´t got any of the codes to work. When reading other issues it looks like others too are having trouble getting Nexa/Proove/Anslut 433mhz to work.

However, on my Arduino I have had great success with sending codes with the Homeeasyhacking library that I found here, using the AM-HRR3 reciever test sketch.

The reciever picks up everything correctly and I can use the information from that with homeeasy lib to send on/off commands flawlessly.

The information from the reciever to use with homeeasy library comes as:
sender: 30144518 (my remote ID)
recipient: 0 (0 to 15 depending on which unit to turn on/off. My remote can handle 16 units)
command: true/false depending if I press on or off button on the remote.

So I just have to pass the ID of my remote control, the number of the wall socket (0-15) and a true or false command to turn on or off. A click with my other, Anslut remote control and the reciever instantly picks up that ID as well. Just change the ID in the Arduino sketch and I control the Anslut sockets just as easy.

So my question is; how big of a task would it be to try and learn to make a custom component out of this for a newcomer? It would be so beautiful to set up a switch in esphome with the ID of the remote control, the number of the socket to control, and an on/off command and let the already working homeeasy library take care of the rest regarding pulses, protocols and what not. If it is possible at all, what tips can you give?

You can see how it looks like in my basic Arduino project here:

Posts: 1

Participants: 1

Read full topic

ESPhome Add on is missing

Having problems getting this to show active in ESPhome

$
0
0

@Rdoull wrote:

hi all,

I have a esp-01s attached to a relay board acting as a switch between two usb ports. I’ve flashed the ESP-01s using ESPHome-Flasher-1.1.0

this is the yaml I flashed

esphome:
  name: elsbeths_charger_test
  platform: ESP8266
  board: esp01_1m

wifi:
  ssid: !secret ssid
  password: !secret password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Elsbeths Charger Test"
    password: !secret appass

captive_portal:

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:

# Enable Web server.
web_server:
  port: 80

# Sync time with Home Assistant.
time:
  - platform: homeassistant
    id: homeassistant_time


# Sensors with general information.
sensor:
  # Uptime sensor used in following formatted uptime sensor
  - platform: uptime
    name: "Elsbeths Charger Test Do Not Use"
    id: e_charger_test_do_not_use
    internal: true
    update_interval: 600s

  # WiFi Signal sensor.
  - platform: wifi_signal
    name: Elsbeths Charger test WiFi Signal
    update_interval: 600s

when flashing it tell me everything is ok, but when I plug the ESP-01s into the relay board and connect to 5v power via usb nothing shows in home assistant, nothing shows in my wifi hub I dunno what I have done wrong.

i’ve got photos on my phone that I’ll add in a sec to help see what I have done.

any help is greatly appretiated

thank you in advance

Posts: 5

Participants: 2

Read full topic

Viewing all 1486 articles
Browse latest View live


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