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

Having issues compiling Dr ZZs automated blind code

$
0
0

@Mship wrote:

Hi,

New to HA and wanted to implement the below Dr ZZs project, Probably should have talked something a little less daunting first :stuck_out_tongue: I am getting a compile error in his esphome/servo_device.yaml (see below). Motor raise/lower is working it is just the tilt servo that is not which makes sense since it wont compile. Any help would be appreciated as I am stuck…

Project link:

Error message:

unknown tag !<!lambda> at line 31, column 51:
… !lambda ‘return level / 100.0;’
^

Full code link:

Posts: 1

Participants: 1

Read full topic


ESPHome and INA219 current sensor seems off by factor of 100

$
0
0

@LKent wrote:

I have connected an INA219 breakout board to a D1 Mini so that the INA219 is measuring only the 5v current into the D1 Mini. I loaded a minimal ESPHome configuration, using the example in the ESPHome doc for the INA219.

When running, I measure across the shunt with a DVM and get 7mV. And the device also reports the same:

'INA219 Shunt Voltage': Sending state 0.00710 V with 3 decimals of accuracy

I believe that the board’s shunt resistor is 0.1 ohm, because a) it has marking ‘R100’, which matches the marking on the board from Adafruit they say theirs is 0.1 ohm, and b) an ‘R10’ chip is supposed to 0.1 ohms so I think R100 is also.

With those numbers, I calculate the current at 0.007v / 0.1 ohm = 0.070 A or 70 mA, which I can accept since I’ve heard that the D1 Mini draws less than 120 mA.

Ok, but, ESPHome reports the current is 0.0007A:

'INA219 Current': Sending state 0.00069 A with 3 decimals of accuracy

So I changed the value of the shunt_resistance: 0.001 ohm

And now it reports the expected current:

'INA219 Current': Sending state 0.07174 A with 3 decimals of accuracy

What is up?

Here is the relevant part of my config:

sensor:
  # the INA219 current sensor
  - platform: ina219
    address: 0x40
    # the board's shunt is 0.1 ohms but I set to 0.001 ohms so the current comes out right
    shunt_resistance: 0.001 ohm
    current:
      name: "INA219 Current"
      accuracy_decimals: 3
    power:
      name: "INA219 Power"
    bus_voltage:
      name: "INA219 Bus Voltage"
    shunt_voltage:
      name: "INA219 Shunt Voltage"
      accuracy_decimals: 3
    max_voltage: 32.0V
    max_current: 3.2A
    update_interval: 10s  

Thanks in advance,
Kent

Posts: 3

Participants: 2

Read full topic

How to let esphone tell hass RF code

$
0
0

@boyyao wrote:

Can I use something like text sensor to get RF code in esphone

In addition. Can Hass send specific RF code through esphone.

It used to be a similar function implemented with openmqttgateway. Now I want to move everything to esphone. I don’t know how.

To view official documents:

It seems that it can only be done in esphone. Can’t give the RF code to the hass

Posts: 1

Participants: 1

Read full topic

Older ESPHome files in the .storage folder

$
0
0

@poldim wrote:

It would seem to me that if you delete an integration or update a sensor, the older file should be removed. This isn’t the case in my .storage folder. I’ve got the following older files:

Are these intentionally being left behind? And is an HA issue that they aren’t being deleted?

Posts: 1

Participants: 1

Read full topic

NodeMCU 32 ESPHome mode: INPUT_PULLDOWN not compiling

$
0
0

@ashscott wrote:

I’m trying to use the mode: INPUT_PULLDOWN option with my defined binary sensors and having no success.

The docs say it’s supported for ESP32 but I can’t get mode: INPUT_PULLUP to compile either.

My config looks like this:

binary_sensor:
  - platform: gpio
    pin: GPIO18
    name: "Drum motor toggle"
    id: drum_motor_toggle
    mode: INPUT_PULLDOWN
    on_press:
      then:
        - switch.toggle: drum_motor

Firstly, is my assumption correct that INPUT_PULLDOWN should be supported and will using it obviate the need for a pull-down resistor when connecting a switch?

I’d appreciate some help. I’ve been at this for ages!

Posts: 9

Participants: 2

Read full topic

Smoothly dim the light on the move sensor release

$
0
0

@Wojtek80 wrote:

Hello Home Assistant and ESPHome comunity.

I working on this project for two weeks now and cannot figure out how to dim the LEDs on exit of (on_release) of the move sensor.

Can I kindly ask you guys for a little bit help please?

Details

What I want to achieve is to:
Going to the room, and:

  1. If there is a day or the ceiling light is on - do nothing.
  2. If there is dark, turn on LEDs
  3. After 10 seconds check is there any move in the room:
    if yes, keep light on
    if not, slowly dim the LEDs down.

I already checked “id(output_component1).set_level(0.7);” in the “on_release” and it is dimming the light. But it is doing it from 1 to 0.7. What I want to achieve is to slowly dim it to the 0.0 value. The code in the “on_release” section is completely messed up. Not sure how to repair it.

  • Environment
    – Heart: ESP8266
    – PIR (Move) Sensor: HC-SR501
    – Light Sensor: LM393
    – PWM 12V

  • The code

esphome:
  name: esp773ba
  platform: ESP8266
  board: esp01_1m

wifi:
  ssid: "XXXX"
  password: "XXXX"

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

captive_portal:

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:

globals:
  - id: glob_var
    type: int
    restore_value: no
    initial_value: '100'

light:
  - platform: monochromatic
    name: "PWM Light"
    output: output_component1
    id: output_component1_light
output:
  - platform: esp8266_pwm
    pin: 4
    id: output_component1
    inverted: False
binary_sensor:
  - platform: gpio
    pin: 2
    name: "Light Sensor"
    device_class: light
    id: light_detect
  - platform: gpio
    pin: 1
    name: "Motion Sensor"
    device_class: motion
    id: move
    on_press:
      then:
        - lambda: !lambda |-
            if (id(light_detect).state) {
              id(output_component1).turn_on();
            } else {
              id(output_component1).turn_off();
            }
    on_release:
      - while:
          condition:
            lambda: 'id(glob_var) != 0;'
          then:
            - light.dim_relative:
                id: output_component1_light
                relative_brightness: 5%
                transition_length: 0.1s
            - lambda: 'id(glob_var) -= 1;'
            - delay: 0.1s

Posts: 1

Participants: 1

Read full topic

ESPhome problem with Ir_Remote and LG TV

$
0
0

@stevedee wrote:

Hello,
i have been trying to turn my LG TV 42LA6208 on and off with esphome for days now. I use a NodeMcu, IR receiver and IR transmitter. The readout works well:

[19:47:32][D][remote.jvc:048]: Received JVC: data=0x20DF
19:47:32][D][remote.lg:053]: Received LG: data=0x20DF10EF, nbits=32
[19:47:32][D][remote.nec:068]: Received NEC: address=0x20DF, command=0x10EF

But if I send the code to the TV, nothing happens. Here’s my config:

remote_receiver:

  • pin:
    number: 14
    mode: INPUT
    inverted: true
    dump: all

remote_transmitter:
pin: 4
carrier_duty_percent: 50%

switch:

  • platform: template
    name: “LG TV Power”
    turn_on_action:
    remote_transmitter.transmit_nec:
    address: 0x20DF
    command: 0x10EF

or:

 remote_transmitter.transmit_lg:
  data: 0x20DF10EF
  nbits: 32

Can anyone help me with this?

Posts: 1

Participants: 1

Read full topic

Alfawise PE1004T

$
0
0

@mattfro wrote:

Hi,
I’m kind of new with esphome and have hard time to understand how to get the leds working on my wifi plug. Could some one help with this?

There are two GPIOs, I think that is in used for the leds(red light and green light). Found some information from a Russian webpage:
GPIO4 is green led
GPIO5 is red led

With my yaml even the red does not work at all, button and relay works fine.
Would like to have it like this:

  • When plug is ON green led would be on.
  • When plug if OFF red led would be on.

Here is my yaml file:

esphome:
  name: indoor_wifi_plug_2
  platform: ESP8266
  board: esp8285

wifi:
  ssid: ""
  password: ""

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

captive_portal:

# Enable logging
logger:

# Enable Web Server (optional)
web_server:
  port: 80
  
# Enable Home Assistant API
api:

ota:

# Text sensors with general information
text_sensor:
  - platform: version
    name: indoor_wifi_plug_2_version
  - platform: wifi_info
    ip_address:
      name: indoor_wifi_plug_2_ip
    ssid:
      name: indoor_wifi_plug_2_ssid
    bssid:
      name: indoor_wifi_plug_2_bssid

binary_sensor:
  - platform: gpio
    pin:
      number: GPIO13
      mode: INPUT_PULLUP
      inverted: true
    name: “indoor_wifi_plug_2 Power Button"
    on_press:
      - switch.toggle: relay

  - platform: status
    name: “indoor_wifi_plug_2 Status"

switch:
  - platform: gpio
    id: red_led
    pin:
      number: GPIO4
      inverted: true
    #restore_mode: ALWAYS_OFF

  - platform: gpio
    name: “indoor_wifi_plug_2"
    pin: GPIO12
    id: relay

sensor:
  # Uptime sensor
  - platform: uptime
    name: indoor_wifi_plug_2_uptime
  # WiFi Signal sensor
  - platform: wifi_signal
    name: indoor_wifi_plug_2_wifi_signal
    update_interval: 10s
    
time:
  - platform: homeassistant
    id: homeassistant_time

Posts: 2

Participants: 2

Read full topic


EspHome & TTGO T-Display: no screen refresh

$
0
0

@busqui04 wrote:

I’ve Home Assistant 0.107.7 with ESPHome 1.14.3 on Hassio installed in my RPi 3B+.

I’ve followed this guide done by musk95: https://github.com/musk95/esphome

The information that appears on the display coming from two homeassistant sensors (temperature and pH) becomes overwritten on every update. I don’t know how to avoid this situation. This is my current .yaml code:

`spi:
  clk_pin: GPIO18
  mosi_pin: GPIO19
  
font:
  - file: "SFNSRounded.ttf"
    id: font_cs
    size: 40

sensor:
  - platform: homeassistant
    entity_id: sensor.sonda_ph_aquari
    id: ph_aqua
    internal: true
  - platform: homeassistant
    entity_id: sensor.temperatura_aquari
    id: temp_aqua
    internal: true
    
display:
  - platform: st7789v
    id: st7789vdisplay
    reset_pin: GPIO23
    dc_pin: GPIO16
    cs_pin: GPIO5
    bl_pin: GPIO4
    rotation: 90°
    brightness: 25%
    update_interval: 1s
    lambda: |-
      if (id(ph_aqua).has_state()) {
        it.printf(55, 60, id(font_cs), 0x7E0, "%.1f pH", id(ph_aqua).state);
      } else {
        it.fill(0x000);
      }
      if (id(temp_aqua).has_state()) {
         it.printf(55, 10, id(font_cs), 0xF800, "%.1f °C", id(temp_aqua).state);
      } else {
        it.fill(0x000);
      }`

Posts: 1

Participants: 1

Read full topic

ESP32 connected, but unavailable in frontend

$
0
0

@stolevegen wrote:

Hi.

I have a bird house where I have installed an ESP32-cam, dallas temperature sensor and a PIR sensor. Everything worked OK, except for random disconnects. I adjusted the settings and everything seemed to work fine. Then, later in the day the sensors and camera image on the frontend became unavailable.

I checked the EspHome UI and the ESP is still green/connected, logs show everything working as it should, but the frontend entities show as unavailable.

I have tried ;

  • Toggle power on ESP32cam
  • OTA update.
  • Restart EspHome add-on
  • Restart Home Assistant
  • Reboot RPi
  • Another OTA update

Anyone else experience the same?
I could try re-flashing the .bin file, but it’s a nightmare removing and re-installing the ESP from the bird house.

YAML ;

substitutions:
  hostname: 'host'
  ssid: 'SSID'
  password: 'PSSWD'
esphome:
  name: $hostname
  platform: ESP32
  board: esp32dev
wifi:
  ssid: $ssid
  password: $password
  manual_ip:
    static_ip: 192.168.xxx.xx
    gateway: 192.168.xxx.xx
    subnet: 255.255.xxx.x
  fast_connect: True
  power_save_mode: none
api:
  reboot_timeout: 0s
ota:
logger:
  level: VERBOSE

# ESP32-CAM
esp32_camera:
  external_clock:
    pin: GPIO0
    frequency: 20MHz
  i2c_pins:
    sda: GPIO26
    scl: GPIO27
  data_pins: [GPIO5, GPIO18, GPIO19, GPIO21, GPIO36, GPIO39, GPIO34, GPIO35]
  vsync_pin: GPIO25
  href_pin: GPIO23
  pixel_clock_pin: GPIO22
  power_down_pin: GPIO32

  name: name
  # ... Frame Settings
  resolution: 400x296
  jpeg_quality: 18
  idle_framerate: 0.05 fps
  max_framerate: 5 fps 

  # ... Temperatur sensor
dallas:
  - pin: 12
    update_interval: 30s
    
sensor:
  - platform: dallas
    address: 0x16051701D54C000X
    name: "temperatur"
    
  # ... motion sensor
    
binary_sensor:
  - platform: gpio
    pin: 13
    name: "motion"
    device_class: motion
    
# Flashlight
output:
  - platform: gpio
    pin: GPIO4
    id: gpio_4
light:
  - platform: binary
    output: gpio_4
    name: $hostname light

Logs ;

INFO Reading configuration /config/esphome/xx.yaml...
INFO Starting log output from xxx using esphome API
INFO Connecting to xxx:xx (xxxx)
INFO Successfully connected to 192.168.2xx.xx
[17:56:55][I][app:100]: ESPHome version 1.14.3 compiled on Apr  1 2020, 07:51:27
[17:56:55][C][wifi:415]: WiFi:
[17:56:55][C][wifi:283]:   SSID: [redacted]
[17:56:55][C][wifi:284]:   IP Address: 192.168.xxx.xx
[17:56:55][C][wifi:286]:   BSSID: [redacted]
[17:56:55][C][wifi:287]:   Hostname: 'xxxx'
[17:56:55][C][wifi:291]:   Signal strength: -49 dB ▂▄▆█
[17:56:55][C][wifi:295]:   Channel: 6
[17:56:55][C][wifi:296]:   Subnet: 255.255.xxx.x
[17:56:55][C][wifi:297]:   Gateway: 192.168.xxx.x
[17:56:55][C][wifi:298]:   DNS1: 0.0.0.0
[17:56:55][C][wifi:299]:   DNS2: 0.0.0.0
[17:56:55][C][gpio.binary_sensor:015]: GPIO Binary Sensor 'motion'
[17:56:55][C][gpio.binary_sensor:015]:   Device Class: 'motion'
[17:56:55][C][gpio.binary_sensor:016]:   Pin: GPIO13 (Mode: INPUT)
[17:56:55][C][gpio.output:010]: GPIO Binary Output:
[17:56:55][C][gpio.output:011]:   Pin: GPIO4 (Mode: OUTPUT)
[17:56:55][C][logger:175]: Logger:
[17:56:55][C][logger:176]:   Level: DEBUG
[17:56:55][C][logger:177]:   Log Baud Rate: 115200
[17:56:55][C][logger:178]:   Hardware UART: UART0
[17:56:55][C][light:177]: Light 'light'
[17:56:55][C][esp32_camera:043]: ESP32 Camera:
[17:56:55][C][esp32_camera:044]:   Name: cam
[17:56:55][C][esp32_camera:045]:   Board Has PSRAM: YES
[17:56:55][C][esp32_camera:047]:   Data Pins: D0:5 D1:18 D2:19 D3:21 D4:36 D5:39 D6:34 D7:35
[17:56:55][C][esp32_camera:048]:   VSYNC Pin: 25
[17:56:55][C][esp32_camera:049]:   HREF Pin: 23
[17:56:55][C][esp32_camera:050]:   Pixel Clock Pin: 22
[17:56:55][C][esp32_camera:051]:   External Clock: Pin:0 Frequency:20000000
[17:56:55][C][esp32_camera:052]:   I2C Pins: SDA:26 SCL:27
[17:56:55][C][esp32_camera:053]:   Reset Pin: -1
[17:56:55][C][esp32_camera:074]:   Resolution: 640x480 (VGA)
[17:56:55][C][esp32_camera:097]:   JPEG Quality: 10
[17:56:55][C][esp32_camera:099]:   Contrast: 0
[17:56:55][C][esp32_camera:100]:   Brightness: 0
[17:56:55][C][esp32_camera:101]:   Saturation: 0
[17:56:55][C][esp32_camera:102]:   Vertical Flip: ON
[17:56:55][C][esp32_camera:103]:   Horizontal Mirror: ON
[17:56:55][C][esp32_camera:120]:   Test Pattern: NO
[17:56:55][C][dallas.sensor:070]: DallasComponent:
[17:56:55][C][dallas.sensor:071]:   Pin: GPIO12 (Mode: INPUT)
[17:56:55][C][dallas.sensor:072]:   Update Interval: 30.0s
[19:17:17][D][dallas.sensor:077]:   Found sensors:
[19:17:17][D][dallas.sensor:080]:     0x16051701D54C00X
[19:17:17][C][dallas.sensor:085]:   Device 'temperatur'
[19:17:17][C][dallas.sensor:085]:     Unit of Measurement: '°C'
[19:17:17][C][dallas.sensor:085]:     Accuracy Decimals: 1
[19:17:17][C][dallas.sensor:085]:     Icon: 'mdi:thermometer'
[19:17:17][V][dallas.sensor:085]:     Unique ID: 'dallas-16051701D54C000X'
[19:17:17][C][dallas.sensor:093]:     Address: 0x16051701D54000X
[19:17:17][C][dallas.sensor:094]:     Resolution: 12
[19:17:17][C][ota:029]: Over-The-Air Updates:
[19:17:17][C][ota:030]:   Address: 192.168.2xx.xx:xxxx
[19:17:17][C][api:095]: API Server:
[19:17:17][C][api:096]:   Address: 192.168.2xx.xx:xxxx
[17:57:00][D][dallas.sensor:148]: 'temperatur': Got Temperature=26.4°C
[17:57:00][D][sensor:092]: 'temperatur': Sending state 26.43750 °C with 1 decimals of accuracy
[17:57:02][D][esp32_camera:157]: Got Image: len=11382

Posts: 12

Participants: 5

Read full topic

MQTT Subscribe Sensor w/ API... doubled entities

$
0
0

@truglodite wrote:

I know the first post would be, “choose one or the other, but don’t use both mqtt and api”. I have some devices that make use of mqtt subscribe, but I really like how the api organizes into separate integrations. Retain is not a big deal for me either way; I’m familiar with how HA uses discovered devices and how to delete them etc. The doubled entities aren’t a huge deal, but I don’t want them if possible as it will increase the size of my influxdb unnecessarily (as well as adding perhaps some unwanted resource overhead).

Is there a way to use the mqtt sub sensor without having doubled up entities (and the startup configuration.yaml override warning in logs)?

…or should I do like I mentioned up front, and turn off the api on my devices that need to use mqtt sub sensors?

TIA,
Kevin

Posts: 1

Participants: 1

Read full topic

Motion sensor (PIR) retriggering time problem

$
0
0

@Wojtek80 wrote:

Hello

I just found out, that my HC-SR501 motion detector has 5 seconds delay between movement notifications. It means when I wave the hand on front of it the state will goes off after that time:

[20:53:**08**][D][binary_sensor:036]: 'Motion Sensor': Sending state ON
[20:53:**11**][D][binary_sensor:036]: 'Motion Sensor': Sending state OFF

So I tried to manipulate the code to make the retrigger faster. I came up to 3 seconds by using delayed_off filter:

binary_sensor:
  - platform: gpio
    pin: 1
    name: "Motion Sensor"
    device_class: motion
    id: move
  - platform: template
    name: "WC motion delayed"
    lambda: |-
      return id(move).state;
    filters:
      - delayed_off: 0ms

The problem is that I want to “see” every movement detected. I don’t need that delay.
Is anybody has the same situation and maybe found resolution for it?

PS. The retriever knob is already turned to minimum.
PS2. I tested on two 501’s.
PS3. Under Arduino Nano works fine…

Posts: 1

Participants: 1

Read full topic

Template Cover - how to get position in ESPHome set by HA UI

$
0
0

@InToSSH wrote:

Hi,
I am setting up a template cover, which has a tilt and a position value (not just closed/open), then I need to do some calculations in lambda.
I know that I can use lambda in ‘tilt_action’ to get the tilt value I set in HA, but I can’t figure out how to get the position.

When I click open/close buttons in HA UI, open/close_actions get triggered, but when I set a manual position in HA, nothing is triggered, so I don’t know where to get the position value… I am missing some kindof ‘position_action’ in ESPHome… Couldn’t find anything in docs. I am on a version 1.14.3.

Posts: 12

Participants: 3

Read full topic

ESPHOME can not compile because of plattformio.org

$
0
0

@skycryer wrote:

I am using hassio from Rasspberry Pi 3 with ESPHome. I wanted to to a new compile today of a module but that failed with error. This RPi is only used for Esphome setup, I usually have a Linus machine running home assistant.

Last time I used Rpi it runs as expected but now it throws this error

[API] ConnectionError: HTTPConnectionPool(host='api.platformio.org', port=80): Max retries exceeded with url: /v2/lib/search?query=name%3A%22Update%22 (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f90f949e8>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',)) (incremented retry: max=5, total=1)

The website is reachable and the status page says everything is online. I pulled also latest version of Home Assistant but nothing helped.

Any idea how to fix that?

Posts: 1

Participants: 1

Read full topic

Getting other sensor's state in custom sensor component

$
0
0

@notherealmarco wrote:

Hi, I’m trying to create a custom sensor (it’s a CO2 and other gasses sensor) in C++.
In order to work properly, I need to calculate the ppm value according to room’s temperature and humidity, and I’ve got this values from another sensor.
Is there a way to get other esphome’s sensors state in my custom sensor class?

Posts: 1

Participants: 1

Read full topic


Beefed Up My Alarm Panel - Check My YAML!

$
0
0

@mrrodge wrote:

Hi all,

To cut a long story short, I have an old alarm system that didn’t work so spent a heck of a lot of time figuring out how it worked and connecting up one of these. To start with I bought the Konnected board but in the end found it didn’t fit my needs so decided to DIY it.

In true ESPHome spirit I wanted the setup to be clever enough to still work if HA/Wi-Fi went down. It also needed to work off the alarm panel’s backup battery if a perp decided to flick off the mains (killing the Wi-Fi and HA instance) before entering. I’ll look into UPSing all my setup at a later date but access points/servers/switches/modems are all in different places so it’s difficult at the moment.

It was a pretty simple system in its heyday and covered only downstairs with two PIRs but I thought the two PIRs could be put to good use for other things in HA and I could use the PIRs on my Hikvision cameras plus Zigbee door/window contacts to supplement the system and even bring in the garage by using the PIR on the Hikvision cam I have in there.

I haven’t done the automations or in fact any config at all on the HA side yet and have just finished testing the ESPHome bit, all working fine. I didn’t bother with the tamper switch/circuit as it’s physically impossible to get to the hardware without setting off via PIR anyway, so didn’t see the need.

Capabilities I’ve cooked in are:

  • SMS notification of power failure (via this) and confirmation that system is still operational, albeit without HA.
  • The ability to arm/disarm the panel without HA or mains power via SMS, with SMS response to confirm acknowledgement.
  • SMS notification when alarm is triggered but only if wireless signal is unavailable i.e. Telegram can’t be used via HA.
  • The ability to arm/disarm and trigger via HA allowing devices outside the alarm panel to trigger.
  • ESPHome to restore states on reset i.e. keep alarm sounding/stay armed when the unit reboots following signal loss.

Just wanted to share as it seems to be going well at the moment but also wanted to ask for further suggestions to make it more robust. For example, I know a call would be better than a single SMS if the alarm is going off but I’m not sure how to program that. Or, would there be a way of sending continuous texts until I disarm the system, without adding hundreds of lines of YAML?

YAML below.

esphome:
  name: tcall
  platform: ESP32
  board: esp32dev

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

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

captive_portal:

# Enable logging
logger:

# Enable Home Assistant API
api:
  password: "***************"
  services:
  - service: send_sms
    variables:
      recipient: string
      message: string
    then:
    - sim800l.send_sms:
        recipient: !lambda 'return recipient;'
        message: !lambda 'return message;'

ota:
  password: "***************************"
  
switch:
  - platform: gpio
    id: "SIM800_PWKEY"
    pin: 4
    restore_mode: ALWAYS_OFF
  - platform: gpio
    id: "SIM800_RST"
    pin: 5
    restore_mode: ALWAYS_ON
  - platform: gpio
    id: "SIM800_POWER"
    pin: 23
    restore_mode: ALWAYS_ON
  - platform: gpio
    inverted: true
    pin: GPIO33
    name: "Alarm Relay"
  - platform: gpio
    inverted: false
    pin: GPIO32
    name: "Strobe Relay"
  - platform: template
    id: "armdisarm"
    name: "Arm/Disarm"
    restore_state: true
    optimistic: true
    on_turn_off:
      then:
      - switch.turn_off: "alarmtriggered"
  - platform: template
    id: "alarmtriggered"
    name: "Alarm Triggered"
    restore_state: true
    optimistic: true
    on_turn_on:
      - if:
          condition:
          - wifi.connected:
          then:
          else:
          - sim800l.send_sms:
              recipient: '+441234567841'
              message: ALARM HAS BEEN TRIGGERED! WIFI CONNECTION UNAVAILABLE. REPLY DISARM TO STOP.
    
uart:
  baud_rate: 9600
  tx_pin: 27
  rx_pin: 26

sim800l:
  on_sms_received:
  - lambda: |-
      id(sms_sender).publish_state(sender);
      id(sms_message).publish_state(message);
      
text_sensor:
- platform: template
  id: sms_sender
  name: "SMS Sender"
- platform: template
  id: sms_message
  name: "SMS Message"
  on_value:
    then:
    - if:
        condition:
          and:
            - text_sensor.state:
                id: sms_message
                state: 'ARM'
            - text_sensor.state:
                id: sms_sender
                state: '+441234567841'
        then:
          - sim800l.send_sms:
              recipient: '+441234567841'
              message: System armed successfully.
          - switch.turn_on: "armdisarm"
    - if:
        condition:
          and:
            - text_sensor.state:
                id: sms_message
                state: 'DISARM'
            - text_sensor.state:
                id: sms_sender
                state: '+441234567841'
        then:
          - sim800l.send_sms:
              recipient: '+441234567841'
              message: System disarmed successfully.
          - switch.turn_off: "armdisarm"
    - delay: 30s
    - text_sensor.template.publish:
        id: sms_sender
        state: "Erased"
    - text_sensor.template.publish:
        id: sms_message
        state: "Erased"          

binary_sensor:
  - platform: gpio
    name: "AC Power Detector"
    id: acpower
    pin:
      number: GPIO25
      inverted: true
    device_class: power
    on_state:
      then:
      - if:
          condition:
            and:
              - binary_sensor.is_off: "acpower"
              - switch.is_on: "armdisarm"
          then:
          - sim800l.send_sms:
              recipient: '+441234567841'
              message: AC POWER FAILURE.  ALARM STILL ARMED.  GARAGE UNPROTECTED.  TEXT DISARM TO DISARM.
      - if:
          condition:
            and:
              - binary_sensor.is_off: "acpower"
              - switch.is_off: "armdisarm"
          then:
          - sim800l.send_sms:
              recipient: '+441234567841'
              message: AC power failure.  To arm alarm in power-off state, text ARM.
      - if:
          condition:
          - binary_sensor.is_on: "acpower"
          then:
          - sim800l.send_sms:
              recipient: '+441234567841'
              message: Power restored.  Normal operation will be resumed shortly.

  - platform: gpio
    name: "Lounge PIR"
    pin:
      number: GPIO19
      mode: INPUT_PULLUP
    device_class: motion
    on_press:
      then:
      - if:
          condition:
          - switch.is_on: "armdisarm"
          then:
          - switch.turn_on: "alarmtriggered"

  - platform: gpio
    name: "Hall PIR"
    pin:
      number: GPIO13
      mode: INPUT_PULLUP
    device_class: motion
    on_press:
      then:
      - if:
          condition:
          - switch.is_on: "armdisarm"
          then:
          - switch.turn_on: "alarmtriggered"

You’ll notice I haven’t linked the alarm trigger switch to the actual relays for siren and strobe yet as I wanted to simulate the alarm being set off without winding up the neighbours! Will do that last.

Thanks and I hope this helps others!

Posts: 1

Participants: 1

Read full topic

[Request] CWWW The problem with the initial installation of light temperature

$
0
0

@VelAndr wrote:

Hello!
When creating a lamp from LED strip, it is impossible to set the initial value of brightness and light temperature. When using the on_boot: trigger, only brightness can be set, but not light temperature. Please add this functionality in the new version of the esphome.
Thanks.

Posts: 2

Participants: 2

Read full topic

16channel relay module ESP32 nodeMCU

$
0
0

@Wilco89 wrote:

Hello,

I do have an issue with switching my relays, by default the are powered on, but when i try to switch them they will stay on.

did change some configuration, en could get them to off state after boot but couldnt get them switched to on.

Ground wire connected to ESP
15 channels connected to different GPIO pins
Board does have is own Power supply

Does someone hafe a solution

esphome:
  name: NAMEOFBOARD
  platform: esp32
  board: nodemcu-32s

wifi:
  ssid: "XXXXXX"
  password: "XXXXXX"

logger:

api:
  password: "XXXXXX"

ota:
  password: "XXXXXXX"

web_server:
  port: 80

switch:
  - platform: gpio
    name: "DRA001"
    pin: 2

Posts: 1

Participants: 1

Read full topic

CT Clamp for ESP

How to pass a variable from Home Assistant front end to ESPHome?

$
0
0

@ashscott wrote:

I have an ESP32 controlling all aspects of my koi pond.

I have a few timers and variables to manage water changes, water levels etc.

Changing these will be much faster and more user friendly if I could pass a value from a HA slider to a global variable in ESPHome.

My thinking is to:

  1. Create an input_number in HA.
  2. Convert the integer to text.
  3. Receive it into ESPHome using HomeAssistant text sensor.
  4. Convert text to integer.
  5. Set ESPHome global variable to integer value.

(2.) and (4.) are the ones I’m struggling with.

Is there a way to go straight from (1.) to (5.), avoiding the conversions?

Can this be done? If so how?

Any suggestions?

Posts: 2

Participants: 1

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>