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

Setting up new ESP32

$
0
0

@rayjay86 wrote:

Sorry total noob at this

I thought I’d try my hand at incorporating some esp32 devices in my house
I’ve got a few xiaomi BLE temp sensors that are well picked up by the Yeelight gateway but the BT range on my Pi4 is awful

I ordered a “ ESP32-PICO-KIT-F, ESP32 Module, Genuine Espressif, USB, 3D Antenna” from an electronics store on eBay based in Australia

I plugged in the device to the USB on my pi and followed the setup instructions via the ESPHome integration and selected esp32 pico

When I try and flash the firmware into the device using the integration it all goes well then says “error resolving IP address of frontside.local” and then asks if the device is connected to wifi. It’s literally sitting beside my Deco mesh unit so range isn’t an issue…
I’ve tried enabling only the 2.4ghz band and it doesn’t change

Am I meant to put in the wifi details to the device before doing all this setup? I thought the esphome integration made this almost a plug and play solution

Any help is appreciated

Posts: 2

Participants: 2

Read full topic


Help with this Lambda

$
0
0

@Pas940 wrote:

This is gettig the better of me, I want it to be fast, like microcontroler fast. I had it working but still had issues with is only running when the sensor updated. I’m trying to implement a crude solar constant voltage input control as an approx to MPP. it doesn’t matter if I get voltage overshoot or undershoot but id like it to be faster than the sensor update.
I think i need the an analog read in a lamda that runs all the time?
logic is simple, if voltage is above 100v increase pwm duty, if it’s below 80v reduce it.

This is where im at with it atm it’s getting messy as im fiddling with it and getting tired.

globals:
   - id: pwm_int
     type: float
     restore_value: no
     initial_value: '0'
   - id: pwm_test
     type: int
     restore_value: no
     initial_value: '0'
esphome:
  name: hotwater
  platform: ESP32
  board: esp-wrover-kit

wifi:
  ssid: "ssid"
  password: "pswd"

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

captive_portal:

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:

output:
  - platform: ledc
    pin: GPIO19
    id: gpio_19
    frequency: 19500


    
sensor:
  - platform: adc
    pin: GPIO34
    filters:
       - multiply: 100
    name: "Hotwater Voltage"
    id: voltage
    update_interval: 3s
  
lambda: !lambda |-
  if (id(voltage)>100) {
       id(pwm_int) += 0.1;
       -output.set_level:
  id: gpio_19

  level: !lambda 'return id(pwm_int);'
      }
 if (id(voltage)<80) {
      id(pwm_int) -= 0.1;
   -output.set_level:
    id: gpio_19
    level: 50% #!lambda 'return id(pwm_int);'
   }
       
      
#    on_value_range:
#      - above: 100.0
#        then:
#           - lambda: 'id(pwm_int) += 0.1;'
#           - output.set_level:
#               id: gpio_19
#               level: !lambda 'return id(pwm_int);'
#      - below: 80.0
#        then:
#          - lambda: 'id(pwm_int) -= 0.1;'
#          - output.set_level:
#              id: gpio_19
#              level: !lambda 'return id(pwm_int);'
#    update_interval: 2s
    
    
#light:
 # - platform: monochromatic
  #  output: gpio_19
   # name: "hotwater pwm"

Posts: 2

Participants: 2

Read full topic

ESPHome 1.14.4 breaks Dallas Sensor [Errno 111] Connection refused

$
0
0

@waphass wrote:

ESPHome 1.14.4 not working with Dallas sensor.

Wifi is connecting and wifi sensor working but if you have dallas: in your config your node will not work anymore and you got [Errno 111] Connection refused.

Posts: 1

Participants: 1

Read full topic

Connecting a bathroom scale to homeassistant

$
0
0

@gald33 wrote:

Hi everyone, I want to hack a scale and use esp8266 and hx711 to automatically pass measurements to home assistant, where I would display it as a sensor.
I know esphome has a HX711 component but I don’t want to update home assistant every time interval. Instead, I want to make sure that a few conditions are met before updating:

  1. The wight was close to zero in the previous measurement.
  2. The weight is above some minimum value.
  3. The weight is somewhat stable: I want to take measurements every 100-250ms and filter out a result if it is too far from the last 2-5 measurements. This is to make sure the object is stabilized.

Are there a built-in methods that achieve something similar, so I can use the hx711 component, or do I need to write the code myself?
Also, if the answer is to use lambdas, then how can I access past results, and how to publish manually to home assistant?
Bonus question, this should run on battaries, so if you think incorporating a switch or use some other technique saves energy, I’d like to know.

Thanks in advance

Posts: 1

Participants: 1

Read full topic

'On ESPHome Counting and display pulses on gpio binary sensor and duration of time switched on'

$
0
0

@albertstuder wrote:

On ESPHome with an ESP8266 i have a remote waterpump connected to a binary_sensor where it shows me the status of the pump ‘ON or OFF’
I try to figured out how to count the ‘ON/OFF’ status over 24hrs and the total ‘ON’ time in that period and to display the results but I was not successful.
I need help for this problem.

Posts: 4

Participants: 2

Read full topic

Esp32 disconnects when using Google WiFi

$
0
0

@salvoc81 wrote:

I have been using Esp32 (through Esphome) to read the data from my xiaomi sensors with no problem for month.
The setup is as follows:

  • Raspberry B+ with HA directly connected to the main router through a LAN cable
  • The esp32 is connected to the Wifi

I have recently bought a Google WiFi and my intension was to migrate the setup to use the network created using GoolgeWifi
I have flashed the Esp32 module to have the network id and passord to access using Google Wifi.
When first start starting Esp32 everything works fine for a few second but soon the module will disconnect with no clear reason.

I would to hear from you and I am sure you can help me to fix this issue.

I have also tried by connecting the RPi with HA directly to google wifi using the a lan cable.
but the problem is not solved

I would love to also hear any suggestions in how to setup using GoogleWifi

Posts: 5

Participants: 3

Read full topic

Resistor Sensor, is this upstream or downstream?

$
0
0

@ideal2545 wrote:

Hey All,

Trying to get some temp reading from an NTC Sensor, im working on getting the readings properly but I’m having a bit of a hard time undrestanding ‘upstream’ vs ‘downstream’, in this pic am I upstream or downstream?

“There are two kinds of configurations for this circuit: Either the variable resistor is close to GND (DOWNSTREAM) or it is closer to VCC (UPSTREAM).”

I think I am downstream but I was hoping someone could confirm for me.

Thanks
Jon

Posts: 5

Participants: 2

Read full topic

Need help for mqtt_subscribe

$
0
0

@IngoNRW wrote:

Hello,

i want to display a HA Value to a LCD attached on ESP
The LCD is ready to use and i know that i must use the mqtt_subscribe

but can i become please a example how i publish the value of my sensor.tank_level to mqtt ?

like this ?

platform: mqtt
topic: home-assistant/tank/
payload_template: {{ states('sensor.tank_level') }}

State ? Value ?

Thank you

Posts: 3

Participants: 3

Read full topic


Using Ultrasonic sensor HC-SR04 in 3-wire mode

$
0
0

@parautenbach wrote:

Is it ok to use this sensor with esphome in 3-wire mode?

I’m thinking it might be ok, having read this paragraph in an online article:

In 3-Wire mode the single I/O pin is used as both an input and as an output. This is possible because there is never a time when both the input and output are being used. By eliminating one I/O pin requirement we can save a connection to our Arduino and use it for something else. It also is useful when using a chip like the ATtiny85 which has a limited number of I/O pins.

My intended example config for using it this way:

sensor:
  - platform: ultrasonic
    name: "Ultrasonic Sensor"
    # use the same pin for the trigger and echo
    trigger_pin: 26
    echo_pin: 26

I’m not sure what the esphome code looks like and haven’t experimented with this.

Then, if I may also ask a second question: What is the unit provided by the sensor? It’s not quite clear to me from the docs whether it’s m or cm.

Posts: 1

Participants: 1

Read full topic

10k NTC Thermistor - Not Reading Resistance Properly?

$
0
0

@ideal2545 wrote:

Hi All,

So I have a 10KOhm thermistor, that I have in series with a 10KOhm 1% resistor. I have the datasheet which effectively states the the B_Constant is 3997 @ 1%. I have verified that the resistance on the thermistor is 10Kohm with my multimeter and also double checked the resistor I’m using to verify that its 10K Ohms.

I should be getting 25C at 10K ohms with this setup is my understanding but I am nowhere near that, at 22.7C I’m basically at 1965Ohms. (not to be confused with KOhms) So I’m very far off. This is how my YAML is configured currently:

sensor:
  - platform: ntc
    sensor: resistance_sensor
    calibration:
      b_constant: 3997
      reference_temperature: 25°C
      reference_resistance: 10kOhm
    name: NTC Temperature B Constant

  - platform: resistance
    id: resistance_sensor
    sensor: source_sensor
    configuration: DOWNSTREAM
    resistor: 10kOhm
    name: Resistance Sensor

  - platform: adc
    id: source_sensor
    pin: A0
    update_interval: 5s

I’m basically wired up like this, except i’m using 3.3V and A0 on an Amica NodeMCU ESP8266

Here’s the breadboard view (red/white wires are heading to the thermistor).

Any help is really appreciated.

Posts: 4

Participants: 2

Read full topic

What is the maximum reading of the pulse width sesnor?

$
0
0

@dave_sausages wrote:

I’ve got an ESP32 running the pulse width sensor on a light detector module attached to the blinking light on my electricity meter. I’m using it to detect the time between pulses so I can accurately calculate my power consumption.

However when the pulse become very spaced out (low power consumption), the ESP reports a width of zero. I’m assuming it does this because it reaches its maximum value and resets before a new pulse is detected. So my question is: what’s the maximum value it can report? And can I increase it some way, by say by changing the resolution from microseconds to milliseconds etc?

Thanks

Posts: 1

Participants: 1

Read full topic

ESPHome Code Assistance

$
0
0

@Gazza wrote:

Hi,

I need some code assistance please.
I am looking to turn a PCF8574 on and off (linked to a light).
It runs off a D1Mini and i have it displaying what i need correctly.
So far code i have.

2c:
  sda: D1
  scl: D2

display:
  - platform: lcd_pcf8574
    id: mydisplay
    dimensions: 20x4
    address: 0x27
    lambda: |-
      it.print(8, 0, "Study");
      it.printf(0, 1, "Temp:     %.1f", id(tempoffice).state);
      it.printf(0, 2, "Humidity: %.0f", id(temphumidity).state);

sensor:
  - platform: homeassistant
    id: tempoffice
    name: tempoffice
    entity_id: sensor.joe_s_office_temperature_2
    internal: true
  - platform: homeassistant
    id: temphumidity
    name: temphumidity
    entity_id: sensor.joe_s_office_humidity
    internal: true

So above works flawlessly.

I just need help if possible writing the second part of the code for ESPHome.
Below is the suggested for movement based sensor.
i just need it to turn on when my desk light is on and off when it is off. My coding is frightful.
TIA

display:
  - platform: lcd_pcf8574
    id: mydisplay
    # ...

binary_sensor:
  - platform: gpio
    # ...
    on_press:
      then:
        - binary_sensor.template.publish:
            id: backlight
            state: ON
        - binary_sensor.template.publish:
            id: backlight
            state: OFF
  - platform: template
    id: backlight
    filters:
      - delayed_off: 90s
    on_press:
      then:
        - lambda: |-
            id(mydisplay).backlight();
    on_release:
      then:
        - lambda: |-
            id(mydisplay).no_backlight();

Posts: 1

Participants: 1

Read full topic

Error when compile .yaml file whit ESPHome

$
0
0

@papacharlie wrote:

220/5000

Hi all, this is my first post.
I have been using Home Assistant for a few months, but suddenly something started to go wrong.
I am going crazy to try to understand what causes this compilation error (the same file in the past was compiled without errors).
This is the .yaml file.
esphome:
name: t_cameretta
platform: ESP8266
board: d1_mini

on_boot:
- lambda: |-
id(oti).set_auth_password(“popoli”);
wifi:
ssid: “Vodafone-"
password: "
***********”

ssid: !secret wifi

password: !secret pass

Enable logging

logger:

Disable UART logging (pins GPIO1/3 are used for endstops)

baud_rate: 0

Enable Home Assistant API

api:

ota:
password: “*****”

password: !secret ota_pw

id: oti

output:

  • platform: gpio
    id: ‘tct_sale’
    pin: D5

Per i relé LOW l’output normalmente è ON (relé eccitato) in assenza tensione allora: inverted: False,

Per i relé HIGH e quelli allo stato solido va bene inverted: inverted: False

inverted: False
  • platform: gpio
    id: ‘tct_scende’
    pin: D6

Per i relé LOW l’output normalmente è ON (relé eccitato) in assenza tensione allora: inverted: False,

Per i relé HIGH e quelli allo stato solido va bene inverted: inverted: inverted: False

inverted: False

switch:

  • platform: output
    name: “tct_sale”
    output: ‘tct_sale’
    id: tct__sale

inverted: false

  • platform: output
    name: “tct_scende”
    output: ‘tct_scende’
    id: tct__scende

inverted: false

binary_sensor:

- platform: status

name: “Stato tapparella Cameretta”

  • platform: gpio
    pin: D4
    name: “cameretta_T”
    filters:
    invert:
    on_press:
    then:
    - lambda: |
    if (id(t_cameretta).position == cover::COVER_OPEN) {
    if (id(tct__sale).state){
    // shade is opening
    id(t_cameretta).stop();
    } else {
    // shade is open and not moving
    id(t_cameretta).close();
    }
    } else {
    if (id(tct__scende).state){
    // shade is closing
    id(t_cameretta).stop();
    } else {
    // shade is closed and not moving
    id(t_cameretta).open();
    }
    }
    cover:
  • platform: template
    name: “Cameretta T”
    id: t_cameretta
    optimistic: true
    open_action:
    • switch.turn_off: tct__scende
    • switch.turn_on: tct__sale
    • delay: 26s
    • switch.turn_off: tct__sale
      close_action:
    • switch.turn_off: tct__sale
    • switch.turn_on: tct__scende
    • delay: 26s
    • switch.turn_off: tct__scende
      stop_action:
    • switch.turn_off: tct__sale
    • switch.turn_off: tct__scende
      I just can’t solve it.
      The output of the compilation is this: (I confirm that the computer is connected to Internel via ethernet cable).
      Thanks for your help.

INFO Reading configuration /config/esphome/t_cameraest.yaml…
INFO Generating C++ source…
INFO Compiling app…
INFO Running: platformio run -d /config/esphome/t_cameraest
Processing t_cameraest (board: d1_mini; framework: arduino; platform: espressif8266@2.2.3)

HARDWARE: ESP8266 80MHz, 80KB RAM, 4MB Flash
Looking for ESPAsyncTCP-esphome library in registry
Warning! You are not connected to the Internet.
If you build a project first time, we need Internet connection to install all dependencies and toolchains.
Warning! You are not connected to the Internet.
If you build a project first time, we need Internet connection to install all dependencies and toolchains.
Dependency Graph
|-- 1.0
|-- 1.2
| |-- 1.0
Compiling /data/t_cameraest/.pioenvs/t_cameraest/src/esphome/components/api/api_connection.cpp.o
Compiling /data/t_cameraest/.pioenvs/t_cameraest/src/esphome/components/api/api_server.cpp.o
Compiling /data/t_cameraest/.pioenvs/t_cameraest/src/esphome/components/api/list_entities.cpp.o
Compiling /data/t_cameraest/.pioenvs/t_cameraest/src/esphome/components/api/subscribe_state.cpp.o
In file included from src/esphome/components/api/api_connection.h:7:0,
from src/esphome/components/api/api_connection.cpp:1:
src/esphome/components/api/api_server.h:19:25: fatal error: ESPAsyncTCP.h: No such file or directory



#include <ESPAsyncTCP.h>
^
compilation terminated.
*** [/data/t_cameraest/.pioenvs/t_cameraest/src/esphome/components/api/api_connection.cpp.o] Error 1
In file included from src/esphome/components/api/api_server.cpp:1:0:
src/esphome/components/api/api_server.h:19:25: fatal error: ESPAsyncTCP.h: No such file or directory



#include <ESPAsyncTCP.h>
^
compilation terminated.
*** [/data/t_cameraest/.pioenvs/t_cameraest/src/esphome/components/api/api_server.cpp.o] Error 1
In file included from src/esphome/components/api/subscribe_state.h:47:0,
from src/esphome/components/api/subscribe_state.cpp:1:
src/esphome/components/api/api_server.h:19:25: fatal error: ESPAsyncTCP.h: No such file or directory



#include <ESPAsyncTCP.h>
^
compilation terminated.
*** [/data/t_cameraest/.pioenvs/t_cameraest/src/esphome/components/api/subscribe_state.cpp.o] Error 1
In file included from src/esphome/components/api/list_entities.h:52:0,
from src/esphome/components/api/list_entities.cpp:1:
src/esphome/components/api/api_server.h:19:25: fatal error: ESPAsyncTCP.h: No such file or directory



#include <ESPAsyncTCP.h>
^
compilation terminated.
*** [/data/t_cameraest/.pioenvs/t_cameraest/src/esphome/components/api/list_entities.cpp.o] Error 1
========================== [FAILED] Took 3.21 seconds ==========================

Posts: 3

Participants: 3

Read full topic

EspHome Native API question

$
0
0

@mspinolo wrote:

Disclaimer:: I am not a network expert hence my statements could be wrong

Hi,

logging my network activity with Wireshark I see Esphome flashed ESP8266/ESP32 send a decent amount of broadcasting messages querying for home assistant IP address.

This leads to a load of the network and IoT devices has usually a limited wifi bandwidth: a huge number of devices could reduce it.

I was wondering if it could be possible (and meaningful) to add to native API component an parameter to make explicit which is HA instance IP address in order to avoid broadcasting.

Posts: 1

Participants: 1

Read full topic

Example request for HA TV remote

$
0
0

@gald33 wrote:

I’m trying to build a device based on esp8266 that makes HA a remote for the TV. The goals are:

  1. To turn TV on/off and change channels and volume from HA.
  2. To intercept (read, not stop) signals sent from the physical remote to the TV so to remember the TV state (is it on? what channel? volume?)
    I’d like the logic and state to be implemented as much as possible in the ESP and not HA, to make it more independent/robust.
    The device sits next to the TV and has an IR receiver and transmitter. I know I should find a way to calibrate for the missed signals (either for the TV or the device), but that’s a problem for tomorrow.

I’m sure many of you built such IR devices for the TV, AC, fan, etc’, and I was hoping you can contribute examples I can learn how to best accomplish that.

Thanks in advance

Posts: 1

Participants: 1

Read full topic


Control power to sensor

$
0
0

@ChrisPriest wrote:

Hi Everyone!

First time here and been searching for an answer to this for a while, hoping someone may have already done it?

I have an ESP32 setup with a resistance water level board, in order to preserve the copper traces, I want to be able to provide power to the sensor, read the value and then turn off the power.

I’d previously done this with my own firmware, but wanted to try and integrate it with HA. I don’t seem to be able to find a way to turn a GPIO pin on (the one providing power to the sensor) prior to the sensor being read.

Does anyone have any ideas on how this could be achieved?

Best Regards and Thank you!
Chris

Posts: 1

Participants: 1

Read full topic

ESPHome on value range

$
0
0

@Skydesign wrote:

Hi Everyone!
Please, help me solve the problem in ESPhome? I have a problem with the switch configuration depending on the temperature.
I want the pump to work in the temperature range, e.g. between 20 and 40 degrees.
Below 20 and above 40 the pump should be switched off.
I tried something like this:

dallas:
  - pin: D4
switch:
  - platform: gpio
    pin: D3
    name: "Pump"
    id: pump1
sensor:
  - platform: dallas
    address: 0x7002
    name: "PT"
    on_value_range:
      above: 20.0
      below: 40.0
      then:
        - switch.turn_on: pump1

But it doesn’t work as it should.
Best Regards and Thank you!

Posts: 2

Participants: 2

Read full topic

Gosund SP111 plug Timer Automation not working

$
0
0

@Tom74 wrote:

Hello,

I have flashed the Gosund SP111 plug with the ESPHome Firmware.
I have setup the ESPHome Component in HA and I can turn on and off the relay on the lovelace card.

For testing purposes I have created a timer automation which should turn off the plug after a given time.
This will not work at all and I can’t the error at moment. Other strange behavior is that I can’t switch off or on the plug via the developer tools. When I change the state to “off” from the energy_01_relay the state gets changedin HA but the relay in the plug itself did’nt switch off.
I can see the following message in the logs:

2020-06-11 17:34:24 WARNING (MainThread) [homeassistant.helpers.service] Unable to find referenced entities switch.energy_01_relay

Additional information:

Gosund ESP Firmware

energy_01.yaml

substitutions:
  plug_name: energy_01
  # Higher value gives lower watt readout
  current_res: "0.00251"
  # Lower value gives lower voltage readout
  voltage_div: "758"

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

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

# Enable logging
logger:

# Enable Web server
web_server:
  port: 80

# Enable Home Assistant API
api:
  password: !secret api_password

ota:
  password: !secret ota_password

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

Automation:

configuration.yaml

input_number:
  light_timer_minutes:
    name: "Light Timer"
    min: 0
    max: 30
    step: 1

input_boolean:
  light_timer_enabled:
    name: "Light timer switch"
    initial: off
    icon: mdi:timelapse

automation.yaml

alias: 'light timer'
  trigger:
    platform: state
    entity_id: switch.energy_01_relay
    to: 'on'
  condition:
  - condition: state
    entity_id: input_boolean.light_timer_enabled
    state: 'on'
  action:
  - delay:
      minutes: "{{ states('input_number.light_timer_minutes') | int }}"
  - service: light.turn_off
    entity_id: switch.energy_01_relay

What’s wrong here?
Has anyone a hint for me?

Thank you.

Posts: 1

Participants: 1

Read full topic

Yeelight 480 info

$
0
0

@kylegordon wrote:

Don’t suppose anyone has torn down a Yeelight 480, or put ESPHome on it?

I’m after a couple, but it’s a bit of an investment with no guarantee that ESPHome will run on it. I don’t trust the factory firmware.

Posts: 1

Participants: 1

Read full topic

ESPHome: coin collector as what (binary_sensor, sensor, pulse_counter, ...)?

$
0
0

@prankousky wrote:

Hi everybody,

I have a CH-926 coin collector which I am trying to integrate to my Home Assistant via ESPHome.

Does anybody here have experience with this kind of device and can help me integrate it in Home Assistant?

The device itself has

  • 12V
  • GND
  • COIN
  • COUNT

pins. I have read you have to connect ground to both your 12V power supply’s ground and your arduino (or in this case, ESP8266). I only tested this with the arduino, and when I do, the device will not power on. So I did in later tests not connect GND to anything other than the 12V power supply.

I have tried these three different ways to integrate it via ESPHome so far

 sensor:
   - platform: adc
     pin: A0
     name: "Coin Collector"
     update_interval: 1s
# OR
 sensor:
   - platform: pulse_counter
     pin: D5
     name: "Pulse Counter"
# OR
binary_sensor:
  - platform: gpio
    pin:
      number: D5
      mode: INPUT_PULLUP
    name: "Input Pullup"
    filters:
      - delayed_on: 2s
      - delayed_off: 2s

I have tried both COIN and COUNT for this, as I wasn’t sure which to use. Neither of these will provide reliable output. Sometimes, it will automatically switch between ON and OFF when I am not doing anything at all, other times it will not switch when I actually insert a coin.

I have also tried putting different resistors in between the ouput (COIN or COUNT) and A0/D5. This will sometimes produce less output, at other times no output at all.

Unfortunately, there isn’t much documentation that I can work with. I have found this sample arduino code, which will work on an Arduino MEGA 2560, well, at least to some extend. It does actually count inserted coins, though it will not reliably identify which coin had been inserted (though this might be configurable when setting up the coin collector).

I read that you can somehow run “generic” arduino code in ESPHome, but I have not the slightest clue on how to do this. Does anybody here and would help me out?

I would at least have this as a binary_sensor entity reporting when any coin has been inserted. If possible, it’d be nice to report which coin had been inserted. So far, I trained the machine to identify three different types of coin (50c, 1€, 2€). This is all just for fun, so the any coin option would already be great, but if possible, I’d like to report the value just for completeness’ sake.

Thank you for your ideas :slight_smile:

Posts: 1

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>