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

ESP32-Cam = Cam & BLE Tracker possible?

$
0
0

@CoolDuke wrote:

is it possible to use the ESP32-Cam as a cam and a BLE tracker simultaneously? I suppose you can, because they are simply to components.

Does anybody have tried it?

Posts: 2

Participants: 2

Read full topic


Unable to connect to GUI

$
0
0

@Scott_Pavey wrote:

I had to restart my ubuntu server today for an update, i run everything in docker containers and now homeassistant will not start with the following error in portainer

2019-12-19 17:27:41 INFO (MainThread) [homeassistant.components.esphome] Can't connect to ESPHome API for rftesting.local: Error resolving IP address: [Errno -3] Try again 2019-12-19 17:27:41 INFO (MainThread) [homeassistant.components.esphome] Trying to reconnect in 60 seconds

rftesting.local is a node long deleted in ESPhome and I thought homeassistant so as i can’t access home assistant I cant fix this any ideas?

So I see I could possibly delete the entity in the storage folder, but the files other than having the esphome prefix bare no relation to the name of the entity

Posts: 2

Participants: 2

Read full topic

WiFi Switch Module EW-WiFi-S01

$
0
0

@DeanoX wrote:

Whilst superficially similair in appearance and functionality to other units these aren’t Tuya and instead use the sonoff EWELink app. Truth be told I already have some similar to previous ones and wanted more…but mis-ordered on AliExpress and got these. However having opened them up - they are ESP8285 with a small additional MCU that appears to handle the high voltage external switch detection.


PCB has RX and TX with pads labelled. A bit of checking and Grnd and VCC are also there but unlabelled. Fortunately GPIO 0 is used for the MCU to indicate the button push - so can be tracked on the PCB. Whilst there is no pad - you can ground one end of the surface mount resistors enough to get into Serial mode and flash. So soldering is required…but I had 4 all flashed without drama

The relevant pins are:-
Switch : GPIO0
Status LED : GPIO13
Relay: GPIO12
There is also a buzzer that I haven’t got working yet.(but i wont use it, so not hugely fussed)

my ESPHome YAML…

...
substitutions:
  switch_id: "sw_04"

status_led:
  pin:
    number: GPIO13
    inverted: True

binary_sensor:
  - platform: gpio
    id: ${switch_id}_in_switch1
    pin: GPIO0
    name: "${switch_id} Switch 1"
    filters:
      - invert:
    internal: true
#
# on_click for momentary switch
#
    on_click:
      min_length: 50ms
      max_length: 350ms
      then:
       - light.toggle: ${switch_id}_light_1
#
# on_state for std rocker switch
#
#    on_state:
#      then:
#        - light.toggle: ${switch_id}_light_1

sensor:
  - platform: wifi_signal
    name: "${switch_id} WiFi Signal Sensor"
    update_interval: 60s


switch:
  - platform: restart
    name: "${switch_id} Restart"
    
light:
  - platform: binary
    name: "${switch_id} Light 1"
    id: "${switch_id}_light_1"
    output: "${switch_id}_output_1"
    
output:
  - platform: gpio
    pin: GPIO12
    id: ${switch_id}_output_1

I have these as a light - because I prefer them to appear in HA that way - can just as easily have them as a switch of course.

Posts: 1

Participants: 1

Read full topic

Evrything work good - cant see the switch in the HA services

$
0
0

@henaa wrote:

Hi
I am used with ESP home dashboard
As you can see i create simple led switch. from the web its work on/off.
The problem - i cant see the switch in the HA services
Why ?

---
esphome:
  name: test
  platform: ESP8266
  board: esp01

# WiFi connection, correct these
# with values for your WiFi.
wifi:
  ssid: ****
  password: ****

# Enable logging.
logger:

# Enable Home Assistant API.
api:

# Enable over-the-air updates.
ota:

# Enable Web server.
web_server:
  port: 80

# Sync time with Home Assistant.
time:
  - platform: homeassistant
    id: homeassistant_time
# Text sensors with general information.
text_sensor:
  # Expose ESPHome version as sensor.
  - platform: version
    name: LED ESPHome Version
  # Expose WiFi information as sensors.
  - platform: wifi_info
    ip_address:
      name: LED IP
    ssid:
      name: LED SSID
    bssid:
      name: LED BSSID
# Sensors with general information.
sensor:
  # Uptime sensor.
  - platform: uptime
    name: TEST Uptime

  # WiFi Signal sensor.
  - platform: wifi_signal
    name: TEST WiFi Signal
    update_interval: 60s
    
switch:
  - platform: gpio
    name: "Living Room Led test"
    pin: GPIO2

Posts: 3

Participants: 2

Read full topic

String as global variable

$
0
0

@tomesp wrote:

I’m trying to define a global var that can store a string. First problem is the right way to define the string (char[] or String?), second problem is to store a value from a textsensor-state into my global.
Here is an example for both of my problems:

globals:
  - id: testglobal
    type: char[5]
    restore_value: no
    #initial_value: '{"a","b","c","d"}'  # does not compile
    #initial_value: '"abcd"'             # does not compile


text_sensor:
  - platform: version
    name: textsensor1
    id: text1
    on_value:
      then:
        - lambda: |-
            ESP_LOGD("main", "text1 = %s", id(text1).state.c_str());
            ESP_LOGD("main", "testglobal = %s", id(testglobal));
            ESP_LOGD("main", "copy testglobal to text1.state:");
            id(text1).state = id(testglobal);
            ESP_LOGD("main", "text1 = %s", id(text1).state.c_str());
            ESP_LOGD("main", "testglobal = %s", id(testglobal));

binary_sensor:
  - platform: gpio
    pin: 
      number: D4
      mode: INPUT_PULLUP
    name: "testing switch"
    filters:
      - delayed_on: 20ms
    on_state:
      then:
        - lambda: |-
            ESP_LOGD("main", "copy text1.state to testglobal:" );
            id(testglobal) = id(text1).state;


If I compile the code above, I get an error (with initial value even more):

src/main.cpp: In lambda function:
src/main.cpp:178:27: error: incompatible types in assignment of 'std::string {aka std::basic_string<char>}' to 'char [5]'
       testglobal->value() = text1->state;
                           ^
*** [.pioenvs/pctext/src/main.cpp.o] Error 1

I’m new to C++, so maybe anyone can point my in right direction?

Thanks in advance
tomesp

Posts: 1

Participants: 1

Read full topic

All devices went offline

$
0
0

@smile wrote:

All devices went offline in My Esphome add-on ( Hassio 0.103.3 Ubuntu 18.04.3 LTS)

Log
[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 00-banner.sh: executing... 

-----------------------------------------------------------
 Hass.io Add-on: ESPHome
 ESPHome Hass.io add-on for intelligently managing all your ESP8266/ESP32 devices.
-----------------------------------------------------------
 Add-on version: 1.13.6
 You are running the latest version of this add-on.
 System: Ubuntu 18.04.3 LTS  (amd64 / qemux86-64)
 Home Assistant version: 0.103.3
 Supervisor version: 193
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums or the Discord chat.
-----------------------------------------------------------
[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-log-level.sh: executing... 
[cont-init.d] 01-log-level.sh: exited 0.
[cont-init.d] 10-requirements.sh: executing... 
[cont-init.d] 10-requirements.sh: exited 0.
[cont-init.d] 20-nginx.sh: executing... 
[cont-init.d] 20-nginx.sh: exited 0.
[cont-init.d] 30-esphome.sh: executing... 
[cont-init.d] 30-esphome.sh: exited 0.
[cont-init.d] 40-migrate.sh: executing... 
[cont-init.d] 40-migrate.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[19:52:51] INFO: Waiting for dashboard to come up...
[services.d] done.
[19:52:51] INFO: Starting ESPHome dashboard...
INFO Starting dashboard web server on unix socket /var/run/esphome.sock and configuration dir /config/esphome...
[19:52:52] INFO: Starting NGINX...
INFO 200 GET / (0.0.0.0) 12.98ms
INFO 101 GET /ace (0.0.0.0) 0.56ms
INFO Running command 'esphome --dashboard -q /config/esphome vscode --ace'
INFO 304 GET /edit?configuration=led_strip.yaml (0.0.0.0) 1.31ms
INFO 302 POST /wizard.html (0.0.0.0) 2.18ms
INFO 200 GET /?begin=True (0.0.0.0) 1.97ms
INFO 101 GET /ace (0.0.0.0) 0.51ms
INFO Running command 'esphome --dashboard -q /config/esphome vscode --ace'
INFO 101 GET /validate (0.0.0.0) 0.63ms
INFO Running command 'esphome --dashboard /config/esphome/we.yaml config'
INFO Process exited with return code 0
INFO 200 GET / (0.0.0.0) 5.20ms
INFO 101 GET /ace (0.0.0.0) 0.73ms
INFO Running command 'esphome --dashboard -q /config/esphome vscode --ace'
INFO 304 GET /edit?configuration=led_strip.yaml (0.0.0.0) 1.99ms
INFO 304 GET /edit?configuration=led_strip.yaml (0.0.0.0) 0.58ms
INFO 200 GET /edit?configuration=we.yaml (0.0.0.0) 1.49ms
INFO 200 POST /edit?configuration=we.yaml (0.0.0.0) 3.07ms
INFO 101 GET /upload (0.0.0.0) 0.41ms
INFO Running command 'esphome --dashboard /config/esphome/we.yaml run --upload-port OTA'
INFO 200 POST /edit?configuration=we.yaml (0.0.0.0) 1.81ms
INFO Process exited with return code 0
INFO 200 GET /edit?configuration=we.yaml (0.0.0.0) 0.40ms
INFO 101 GET /compile (0.0.0.0) 0.61ms
INFO Running command 'esphome --dashboard /config/esphome/we.yaml compile'
INFO Process exited with return code 0
INFO 200 GET /download.bin?configuration=we.yaml (0.0.0.0) 3.63ms
INFO 101 GET /logs (0.0.0.0) 0.86ms
INFO Running command 'esphome --dashboard /config/esphome/door_bell.yaml logs --serial-port OTA'
INFO 200 GET / (0.0.0.0) 6.85ms
INFO 101 GET /ace (0.0.0.0) 1.69ms
INFO Running command 'esphome --dashboard -q /config/esphome vscode --ace'
INFO 304 GET / (0.0.0.0) 4.49ms
INFO 101 GET /ace (0.0.0.0) 0.41ms
INFO Running command 'esphome --dashboard -q /config/esphome vscode --ace'
INFO 304 GET / (0.0.0.0) 4.21ms
INFO 101 GET /ace (0.0.0.0) 1.85ms
INFO Running command 'esphome --dashboard -q /config/esphome vscode --ace'
INFO 101 GET /ace (0.0.0.0) 0.42ms
INFO Running command 'esphome --dashboard -q /config/esphome vscode --ace'
INFO 200 GET / (0.0.0.0) 5.97ms
INFO 101 GET /ace (0.0.0.0) 0.33ms
INFO Running command 'esphome --dashboard -q /config/esphome vscode --ace'
INFO 304 GET / (0.0.0.0) 4.53ms
INFO 101 GET /ace (0.0.0.0) 1.93ms
INFO Running command 'esphome --dashboard -q /config/esphome vscode --ace'
INFO 304 GET / (0.0.0.0) 3.87ms
INFO 101 GET /ace (0.0.0.0) 1.97ms
INFO Running command 'esphome --dashboard -q /config/esphome vscode --ace'

Posts: 1

Participants: 1

Read full topic

Custom output Component with a tlc5947

$
0
0

@freddag wrote:

I have been working at understanding how to add a custom component for controlling led strip sections with a 24 channel tlc5947 chip attached via SPI to an ESP32.
I feel like it should be quite easy as Adafruit has a library that could be used for communication.
Purley and simply I have not been able to get my head around adding such a thing even after reading the documentation many of times. Any help to get a better understanding would be very useful.

Posts: 1

Participants: 1

Read full topic

Component not found: http_request

$
0
0

@coderanger wrote:

Trying to use http_request, but I’m getting a “component not found error” when I try to enable it as per the docs at https://next.esphome.io/components/http_request.html. Do I need to do something to enable it somewhere else? Running ESPHome 1.14.3.

I noticed the docs say that this component works only with Arduino framework 2.5.0 or newer. I’m using an ESP32 for this project and noticed that the Arduino version numbers are completely different (v1.x vs v2.x). Is it doing a simple version check without respect to platform or is the ESP32 version of Arduino not feature compatible with the ESP8266 series?

Posts: 6

Participants: 2

Read full topic


Light brightness between certain hours

$
0
0

@beireken wrote:

I have following binary sensor controlling a HA service to toggle a light:

  - platform: gpio
    name: "2e Kinderkamer"
    device_class: light
    pin:
      number: GPIO13
      inverted: True
      mode: INPUT_PULLUP
    filters:
      -  delayed_on: 50ms
      -  delayed_off: 50ms
    on_press:
      then:
        - homeassistant.service:
            service: light.toggle
            data:
              entity_id: light.wout

Now i would like this light to turn on to a certain brightness when the time is between certain hours at night. But i’m clueless how i could implement this with esphome.
I can always do a HA automation but would prefer it in esphome!

Posts: 1

Participants: 1

Read full topic

Only getting whole number temp readings from my DHT 11 sensor

$
0
0

@Rdoull wrote:

hi all,

I have a sensor for my lounge giving me temp and humidity readings though I am only getting whole number readings… is this something I can change?

here is my yaml file for the sensor.

esphome:
  name: lounge_sensor
  platform: ESP8266
  board: d1_mini

wifi:
  ssid: !secret ssid
  password: !secret password
  manual_ip:
    static_ip: 192.168.0.45
    gateway: 192.168.0.1
    subnet: 255.255.255.0
    dns1: 192.168.0.1
    dns2: 192.168.0.1
  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Lounge Sensor Fallback Hotspot"
    password: "Cerberus"

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

i2c:
  sda: 4  # (Optional, Pin): The pin for the data line of the I²C bus. Defaults to GPIO4 for ESP8266.
  scl: 5  # (Optional, Pin): The pin for the clock line of the I²C bus. Defaults to GPIO5 for ESP8266.
  scan: True # (Optional, boolean): If ESPHome should do a search of the I²C address space on startup. Defaults to True.
  id: bus_a

sensor:
  - platform: wifi_signal
    name: "Lounge Sensor WiFi signal"
    update_interval: 120s

  - platform: uptime
    name: "Lounge Sensor uptime do not use"
    id: lounge_sensor_uptime_do_not_use
    internal: true
    update_interval: 15s

  - platform: tsl2561
    name: "Lounge Ambient Light"
    icon: mdi:lightbulb-on-outline
    address: 0x39
    update_interval: 60s
 
  - platform: dht
    pin: D3
    model: DHT11
    temperature:
      name: "Lounge Temperature"
    humidity:
      name: "Lounge Humidity"
    update_interval: 3s
   
    
text_sensor:
  - platform: version
    name: "Lounge Sensor ESPHome version"
    
  - platform: template
    name: "Lounge Sensor Uptime"
    lambda: |-
      uint32_t dur = id(lounge_sensor_uptime_do_not_use).state;
      int dys = 0;
      int hrs = 0;
      int mnts = 0;
      if (dur > 86399) {
        dys = trunc(dur / 86400);
        dur = dur - (dys * 86400);
      }
      if (dur > 3599) {
        hrs = trunc(dur / 3600);
        dur = dur - (hrs * 3600);
      }
      if (dur > 59) {
        mnts = trunc(dur / 60);
        dur = dur - (mnts * 60);
      }
      char buffer[17];
      sprintf(buffer, "%ud %02uh %02um %02us", dys, hrs, mnts, dur);
      return {buffer};
    icon: mdi:clock-start
    update_interval: 15s

switch:
  - platform: restart
    name: Lounge Sensor Restart

can I do anything in the yaml to sort this? or do I need a new board or sensor?

thank you for your help and time

Posts: 3

Participants: 3

Read full topic

Esphome Bluetooth Keyboard

$
0
0

@keithcroshaw wrote:

I’d like to create a Bluetooth keyboard emulator Esp32 device that on motion detection will send keystrokes that can control an iPad. I can do what i want with my real bt keyboard.

If anybody Has any examples of anything similar they’ve done that’d be awesome.

Thanks!

Posts: 1

Participants: 1

Read full topic

ESPHome switch configuration - HomeBridge

$
0
0

@Depechie wrote:

I added a relay to my ESP8266 with following ESPHome yaml:

switch:
- platform: gpio
  id: relay
  pin:
    number: D6
    inverted: False
  restore_mode: ALWAYS_OFF
- platform: template
  name: "Garage Door Switch"
  icon: "mdi:garage"
  turn_on_action:
  - switch.turn_on: relay
  - delay: 1s
  - switch.turn_off: relay

And this is actually working perfectly in Home Assistant! So I have a switch in Home Assistant and if I click it, it will turn on and after a second turn off again. Also the relay will toggle.
But the HomeBridge component shows the switch in HomeKit as a normal switch. Meaning, if I press the switch in HomeKit, the status will go from Off to On and stay on. Even though In Home Assistant it will go off again after 1 sec.

So now I need to manually tap twice on the switch in HomeKit before I can again use it.

How are other people using toggle relays with the HomeBridge link?
Do I need to put the actual toggle in a Home Assistant automation instead of inside the ESPHome config yaml? Any other tips?

Posts: 1

Participants: 1

Read full topic

Timeout between binary sensor (button) presses

$
0
0

@DiamondCocktail wrote:

I was wondering how I would configure a timeout or “dead zone” between button presses so my automations would not be called multiple times. I saw the filters delayed_on: options but I wasn’t sure if this was what I was looking for.

Thanks for such a great project and the help in advance.

Posts: 3

Participants: 3

Read full topic

RGBWW lights not working as expected using Esphome and Homeassistant

$
0
0

@kvjajoo wrote:

Hi,

I recently flashed one of my OffDarks brand RGBWW ceiling lights with Esphome. The lights came with a firmware which uses Magic Home Pro app for controlling the light. But since the flux_led component of HA does not work smoothly i decided to flash it off it Tasmota or Esphome.

I tried tasmota first using this link as reference. All worked but somehow my Alexa was not able to set the color warm white or cool white. This worked perfectly with factory firmware so i am sure there is no issue with lights itself.

I then decided to flash it with esphome and Now I have a different problem. The RGB Lights and CWWW lights are working independently. They turn on together which should not be happening. Also the brightness setting controls the brightness of RGB lights only. The CWWW lights are controlled by Color temperature and White Value.

This is not something I want. I want only one type of light to be on and not both. Also brightness should control either RGB or CWWW which ever is in use. Can someone please help me in rectifying the code below. I used this code as per esphome wiki pages:

esphome:
  name: mb_light_left
  platform: ESP8266
  board: nodemcuv2

wifi:
  ssid: 'myssid'
  password: 'mypassword'
  fast_connect: on
  manual_ip:
    static_ip: 192.168.2.210
    gateway: 192.168.2.1
    subnet: 255.255.255.0
    
># Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Mb Light Left Fallback Hotspot"
    password: "mypassword"

captive_portal:

api:
  password: 'mypassword'

logger:

ota:
  password: 'mypassword'

web_server:
  port: 80

time:
  - platform: sntp
    id: sntp_time
    timezone: Asia/Kolkata
    servers: 192.168.2.1
    
light:
  - platform: rgbww
    name: "Master Bedroom Light Left"
    red: output_component1
    green: output_component2
    blue: output_component3
    cold_white: output_component4
    warm_white: output_component5
    cold_white_color_temperature: 6536 K
    warm_white_color_temperature: 2000 K

output:
  - platform: esp8266_pwm
    id: output_component1
    pin: D1

  - platform: esp8266_pwm
    id: output_component2
    pin: D2
    
  - platform: esp8266_pwm
    id: output_component3
    pin: D5

  - platform: esp8266_pwm
    id: output_component4
    pin: D7
    
  - platform: esp8266_pwm
    id: output_component5
    pin: D6

Posts: 1

Participants: 1

Read full topic

DHT 22 sensor after 24-30 hours change status to "unknown"

$
0
0

@henaa wrote:

Hi
I have some problem
after 24 hours the device change to “unknown” and not show any sensor data
(i change to GPIO2 and GPIO0 )
why its happen and how fix this issue ?

---
esphome:
  name: livingroom
  platform: ESP8266
  board: esp01

# WiFi connection, correct these
# with values for your WiFi.
wifi:
  ssid: ****
  password: *********

# Enable logging.
logger:

# Enable Home Assistant API.
api:

# Enable over-the-air updates.
ota:

# Enable Web server.
web_server:
  port: 80

# Sync time with Home Assistant.
time:
  - platform: homeassistant
    id: homeassistant_time
# Example configuration entry
sensor:
  - platform: dht
    pin: GPIO0
    temperature:
      name: "Living Room Temperature"
    humidity:
      name: "Living Room Humidity"
    update_interval: 60s

Posts: 1

Participants: 1

Read full topic


Platform.io down ... no compilation

Esp-wroom-32

$
0
0

@curious wrote:

Santa brought me a ESP-WROOM-32 because I would like to make a salt-level-indicator. I thought I could easily follow the instructions found here https://adonno.com/salt-level-sensor/

But : I cannot find a 5 volts output and whats more confusing …my esp has two rows of pin holes on both sides
So can some of you tell what row to use and where to find the 5v output ? Or did I ask Santa for the wrong hardware ??


On another forum some one told me I could probably use this ESP32- but he could not tell me pins to use. I hope someone here can.

Thanks in advance

Posts: 12

Participants: 4

Read full topic

Send OFF Repeat in X time

$
0
0

@mocho wrote:

Hello,
I have esphome connected to HA with several sensors.
My problem is that the PIR sensor Only sends the state when it changes, if for some reason the esphome node can not contact HA when sending the off signal, the sensor stays in ON state in HA until it changes state again.

How can I solve this? I’m thinking the best is ESPHome repeat the oFF time every x time. But How?

Posts: 2

Participants: 2

Read full topic

Thermocouple temperature readings completely off when LED strip is turned on

$
0
0

@exxamalte wrote:

I have built a new ESPHome based device that shows a strange behaviour and I was hoping to get my design validated:
I added a MAX31855 thermocouple sensor and an WS2813 LED strip (with 96 LEDs) to a NodeMCU ESP32 running ESPHome 1.14.3. When the lights are off, the temperature readings are normal, but when I turn on the lights, the temperature readings drop by 8-10ºC, and when I then turn on a light effect (e.g. rainbow) the temperature readings drop by about 50-150ºC.

MAX31855 configuration:

spi:
  clk_pin: GPIO18
  miso_pin: GPIO19

sensor:
  - platform: max31855
    name: "Temperature"
    cs_pin: GPIO5
    update_interval: 15s
    filters:
      - sliding_window_moving_average:
          window_size: 6
          send_every: 4

LED strip configuration:

light:
  - platform: fastled_clockless
    name: "Lights"
    chipset: WS2813
    pin: GPIO33
    num_leds: 96
    rgb_order: GRB
    max_refresh_rate: 32ms
    effects:
      - addressable_rainbow:
          name: Rainbow fast
          speed: 10

Log extract:

[18:50:22][D][max31855:080]: 'Temperature': Got temperature=20.8°C
[18:50:37][D][max31855:080]: 'Temperature': Got temperature=21.0°C
[18:50:52][D][max31855:080]: 'Temperature': Got temperature=20.2°C
[18:51:07][D][max31855:080]: 'Temperature': Got temperature=21.0°C
[18:51:07][D][sensor:092]: 'Temperature': Sending state 20.15000 °C with 1 decimals of accuracy
[18:51:22][D][max31855:080]: 'Temperature': Got temperature=21.2°C
[18:51:37][D][max31855:080]: 'Temperature': Got temperature=20.8°C
[18:51:52][D][max31855:080]: 'Temperature': Got temperature=21.5°C
[18:51:59][D][light:264]: 'Lights' Setting:
[18:51:59][D][light:273]:   State: ON
[18:51:59][D][light:303]:   Transition Length: 1.0s
[18:52:07][D][max31855:080]: 'Temperature': Got temperature=13.8°C
[18:52:07][D][sensor:092]: 'Temperature': Sending state 19.75000 °C with 1 decimals of accuracy
[18:52:22][D][max31855:080]: 'Temperature': Got temperature=14.0°C
[18:52:37][D][max31855:080]: 'Temperature': Got temperature=13.0°C
[18:52:52][D][max31855:080]: 'Temperature': Got temperature=12.2°C
[18:53:07][D][max31855:080]: 'Temperature': Got temperature=12.8°C
[18:53:07][D][sensor:092]: 'Temperature': Sending state 14.54167 °C with 1 decimals of accuracy
[18:53:22][D][max31855:080]: 'Temperature': Got temperature=13.5°C
[18:53:37][D][max31855:080]: 'Temperature': Got temperature=14.2°C
[18:53:52][D][max31855:080]: 'Temperature': Got temperature=14.2°C
[18:54:07][D][max31855:080]: 'Temperature': Got temperature=12.8°C
[18:54:07][D][sensor:092]: 'Temperature': Sending state 13.29167 °C with 1 decimals of accuracy
[18:54:22][D][max31855:080]: 'Temperature': Got temperature=14.5°C
[18:54:37][D][max31855:080]: 'Temperature': Got temperature=12.8°C
[18:54:52][D][max31855:080]: 'Temperature': Got temperature=10.2°C
[18:55:07][D][max31855:080]: 'Temperature': Got temperature=14.5°C
[18:55:07][D][sensor:092]: 'Temperature': Sending state 13.16667 °C with 1 decimals of accuracy
[18:55:08][D][light:264]: 'Lights' Setting:
[18:55:08][D][light:326]:   Effect: 'Rainbow fast'
[18:55:22][D][max31855:080]: 'Temperature': Got temperature=-25.0°C
[18:55:37][D][max31855:080]: 'Temperature': Got temperature=-35.8°C
[18:55:52][D][max31855:080]: 'Temperature': Got temperature=-26.5°C
[18:56:07][D][max31855:080]: 'Temperature': Got temperature=-28.8°C
[18:56:07][D][sensor:092]: 'Temperature': Sending state -15.20833 °C with 1 decimals of accuracy
[18:56:22][D][max31855:080]: 'Temperature': Got temperature=-31.0°C
[18:56:37][D][max31855:080]: 'Temperature': Got temperature=-24.5°C
[18:56:52][D][max31855:080]: 'Temperature': Got temperature=-33.0°C
[18:57:07][D][max31855:080]: 'Temperature': Got temperature=-21.0°C
[18:57:07][D][sensor:092]: 'Temperature': Sending state -27.45833 °C with 1 decimals of accuracy
[18:57:22][D][max31855:080]: 'Temperature': Got temperature=-26.0°C
[18:57:38][D][max31855:080]: 'Temperature': Got temperature=-34.0°C
[18:57:52][D][max31855:080]: 'Temperature': Got temperature=-25.2°C
[18:58:07][D][max31855:080]: 'Temperature': Got temperature=-29.5°C
[18:58:07][D][sensor:092]: 'Temperature': Sending state -28.12500 °C with 1 decimals of accuracy
[18:58:22][D][max31855:080]: 'Temperature': Got temperature=-8.5°C
[18:58:37][D][max31855:080]: 'Temperature': Got temperature=-35.2°C
[18:58:52][D][max31855:080]: 'Temperature': Got temperature=-34.5°C
[18:59:07][D][max31855:080]: 'Temperature': Got temperature=-33.5°C
[18:59:07][D][sensor:092]: 'Temperature': Sending state -27.75000 °C with 1 decimals of accuracy
[18:59:22][D][max31855:080]: 'Temperature': Got temperature=-26.2°C
[18:59:37][D][max31855:080]: 'Temperature': Got temperature=-30.5°C
[19:00:37][D][max31855:080]: 'Temperature': Got temperature=-11.5°C
[19:00:51][D][max31855:080]: 'Temperature': Got temperature=-29.5°C
[19:00:52][D][light:264]: 'Lights' Setting:
[19:00:52][D][light:273]:   State: OFF
[19:00:52][D][light:303]:   Transition Length: 1.0s
[19:00:52][D][light:309]:   Effect: 'None'
[19:01:06][D][max31855:080]: 'Temperature': Got temperature=20.8°C
[19:01:07][D][sensor:092]: 'Temperature': Sending state -10.29167 °C with 1 decimals of accuracy
[19:01:22][D][max31855:080]: 'Temperature': Got temperature=20.2°C
[19:01:36][D][max31855:080]: 'Temperature': Got temperature=21.0°C
[19:01:52][D][max31855:080]: 'Temperature': Got temperature=21.2°C
[19:02:07][D][max31855:080]: 'Temperature': Got temperature=21.2°C
[19:02:07][D][sensor:092]: 'Temperature': Sending state 12.50000 °C with 1 decimals of accuracy
[19:02:22][D][max31855:080]: 'Temperature': Got temperature=21.0°C
[19:02:37][D][max31855:080]: 'Temperature': Got temperature=21.2°C
[19:02:52][D][max31855:080]: 'Temperature': Got temperature=20.2°C
[19:03:07][D][max31855:080]: 'Temperature': Got temperature=21.5°C
[19:03:07][D][sensor:092]: 'Temperature': Sending state 21.08333 °C with 1 decimals of accuracy
[19:03:22][D][max31855:080]: 'Temperature': Got temperature=21.5°C
[19:03:38][D][max31855:080]: 'Temperature': Got temperature=21.0°C

I have already noticed that changing the max_refresh_rate value in the fastled_clockless configuration has an impact on the effect, i.e. the smaller the value (shorter refresh rate), the higher the temperature deviation.

Have I hit the hardware limitations of the ESP? Has anyone seen a similar effect with any other sensors and resolved this issue somehow?

Posts: 2

Participants: 2

Read full topic

DIY Replacement Alarm Panel

$
0
0

@DeanoX wrote:

Have just completed a project thats been in the plans for a while. Final implementation was actually remarkably straight forward all thanks to how quick,easy and flexible ESP Home is.

I wired the house with a “Comfort” home alarm/home automation system 18?+ years ago. At the time I interfaced it through homeseer and had a number of automations controlling X10 lights etc… In practice its been unused for many years. However I wanted to re-use the wired PIRs for general occupancy detection. As “proper” alarm zones they have End of Line (EOL) resistors to detect the differences between open circuit, short circuit, alarm and Ok for each zone. To detect motion - you need to measure the voltage (resistance) on each PIR Zone rather than just detect open/close.

There is at least one replacement alarm panel - which casually dismisses the EOL resistors and tells you to remove them. I didn’t fancy opening up every PIR to remove them…and they’re actually very useful in detecting wiring faults etc. even if just for HA rather than security. A quick google turns up several circuits though. This Page in particular is excellent in explaining how they work - and how to detect the various zone states with an arduino and an A to D channel.

A check of the various ESPHome supported sensors and I found the ADS1115. 4 A to D channels…and up to 4 board supported. Upto 16 A to D channels for only 2 ESP pins. A couple of boards ordered (I wanted 8 zones) and a very easy breadboard and I proved the principle of detecting the voltage in the various states. Monitoring the actual recorded voltage with a specific set of resistors makes it possible to the then detect the state reliably. In ESP home - each channel on the ADS1115 reflects a zone and gets its own sensor for the voltage. This stays internal, but when it changes 2 other template sensors are updated according to the voltage. An integer sensor reflecting the state (1=Short,2=Alarm,3=OK,4=Open/Tamper) and a string with the state name. Both are exposed to HA currently (not sure in practice which I will use in automations).

I also wanted the panel to be able to show the state of each zone - so a string of neopixels is used. Each led reflects a zone. The partition function is used so each zone has a light (1 led) but all is driven off a single pin. A common set of effects (green, red, blinking etc) is inlcuded for each light. Not the most memory efficient…but it works very well.

And because i dont always need the LEDs flashing away - there’s a capacative touch switch (because I had some!) that is used to enable/disable the led updates. Also added a temp sensor (DHT11) because…why not.

I have a couple of spare GPIO wired for a couple of other flow switches I want to use aswell.

The PIRs need 12V and the D1 mini is 5V, so I used a spare small PC psu and a break out board that gives the 12/5/3.3. All mounted in the original alarm enclosure. I mounted the D1 mini, DHT11, ADS1115 etc on some perfboard which made the wiring very easy, including screw terminal blocks for the PIRs. Also included some 12v distribution terminal blocks aswell.

There’s clearly a lot of repetition with an LED, ADS1115 and 2 template sensors per zone in the YAML - but actually the meat of the code is straightforward.

Full YAML is Here

Key elements for a single zone are below (not a complete running yaml!) with a few pics.

So far all working very well - and just re-inforces how easy ESPHome + HA makes this. Now to actually do something useful with the motion detection !.

Original panel, including backup battery…

Breadboarding test…

Mounting the ESP in the panel

Fitted and working…

substitutions:
# Common ADS1115 Sensor Setting
  ads_gain: "6.144"
  ads_update_interval: "500ms"
  ads_delta: "0.2"
  ads_heartbeat: "120s"
  
# Common Text Sensor Setting
  zone_icon: "mdi:lock-alert"

# Common Zone (Int) Sensor Setting
  sensor_icon: "mdi:shield-lock"

# Transition Voltages between States
#  0 -> (State1) -> V1 -> (State2) -> V2 -> (State3) -> V3 -> (State4)
  v1: "1"
  v2: "2.5"
  v3: "3.5"

# Text Sensor strings for each state
  alarm_state1: "Short"
  alarm_state2: "OK"
  alarm_state3: "Alarm"
  alarm_state4: "Tamper"

# Led Effect (Appended to led name for Custom Effect)
  led_effect1: "RED_BLINK_FAST"
  led_effect2: "GREEN"
  led_effect3: "RED"
  led_effect4: "RED_BLINK_FAST"

# I2C Settings for 2 x ADS1115 
i2c:
  sda: GPIO4
  scl: GPIO5
  scan: False

ads1115:
# 1st ADS1115 (ADDR -> Grnd)
  - address: 0x48
    id: ads1115_1
# 2nd ADS1115 (ADDR -> VDD)
  - address: 0x49
    id: ads1115_2

# NEOPixel Leds. 1 String with 1 LED / Zone via partition
light:
  # Define Parent String
  - platform: fastled_clockless
    chipset: WS2812B
    internal: true
    rgb_order: GRB
    default_transition_length: 0s
    pin: GPIO15
    color_correct : 
      - ${led_bright}
      - ${led_bright}
      - ${led_bright}
    num_leds: 12
    name: "LED_Status_String"
    id: led_string

    # 1 Partition (Indicator LED) per Zone
    # Zone 1
  - platform: partition
    id: led_01
    internal: true
    name: "Zone 1 LED"
    default_transition_length: 0s
    segments:
      - id: led_string
        from: 0
        to: 0
    # Include Common Effects - RED/GREEN/BLINK_RED_SLOW/BLINK_RED_FAST
    effects: !include include/esp_include_alarm_led_effect.yaml
    # Zone 2

sensor:
  - platform: template
    name: "Zone01 Sensor"
    id: zone_01_int
    icon: "${sensor_icon}"
    on_value:
      # When Zone state (1-4) changes, set effect if Lights enabled, Set Text State
      - lambda: |-
          std::string out_effect[] = {"Unset","${led_effect1}","${led_effect2}","${led_effect3}","${led_effect4}" };
          std::string out_state[] = {"Unset","${alarm_state1}","${alarm_state2}","${alarm_state3}","${alarm_state4}" };
          int y = (int) x;
          if (id(sw_lights_enable).state) {
            auto call = id(led_01).turn_on();
            call.set_effect(out_effect[y]);
            call.perform();
          }
          id(zone_01_str).publish_state(out_state[y]);

  # ADS1115 Voltage Sensors (1 per Zone)  
  - platform: ads1115
    ads1115_id: ads1115_1
    multiplexer: 'A0_GND'
    gain: ${ads_gain}
    name: "ADS1115-1-A0"
    id: ads1115_1_a0
    update_interval: ${ads_update_interval}
    internal: true
    filters:
      - or:
        - delta: ${ads_delta}
        - heartbeat: ${ads_heartbeat}
    on_value:
      then:
        # Compare Reading to Ref voltages and set zone state (Int) if changed.
        - lambda: |-
            int y = 0;
            if (x > ${v3}) { y = 4; }                     // # State 4 = Tamper/Short = Red_Blink
            else if (x > ${v2} && x <= ${v3}) { y = 3; }  // # State 3 = Alarm = Red
            else if (x > ${v1} && x <= ${v2}) { y = 2; }  // # State 2 = OK = Green
            else if (x <= ${v1}) { y = 1; }               // # State 1 = Short = Red Blink
            if (id(zone_01_int).state != y) {
              id(zone_01_int).publish_state(y);
            }

text_sensor:
  - platform: template
    name: "Zone01 State"
    icon: "${zone_icon}"
    id: zone_01_str

Posts: 1

Participants: 1

Read full topic

Viewing all 1486 articles
Browse latest View live