Hi,
I am working on a way to check if there is anything in my mailbox. I want the use what is called a latching power switch circuit - see more here (https://randomnerdtutorials.com/latching-power-switch-circuit-auto-power-off-circuit-esp32-esp8266-arduino/) for those interested, really a fantastic thing that uses almost no power, years and years on battery, longer than deep sleep.
So, I have made the ESP code. It seems to be working. I have made both a switch and a binary sensor, just as part of testing as I could not get the automation (see further down) to work and thought perhaps that had something to do with it.
And I am so sorry about the formatting. It comes out a bit strange even if I use ´´´, and I tried to copy it first into Notepad++ to see if that made a difference, seems not… EDIT: Got it, needed the backtick.
esphome:
name: postkasse
platform: ESP8266
board: nodemcuv2
on_boot:
then:
switch.turn_on: generic_out_swith
wifi:
ssid: "xxxx"
password: "xxxx”
captive_portal:
logger:
api:
ota:
output:
- platform: gpio
id: generic_out
pin: D8
switch:
- platform: gpio
pin: D8
name: Generic_Output
id: generic_out_swith
restore_mode: ALWAYS_ON
binary_sensor:
- platform: gpio
pin:
number: D2
mode: INPUT_PULLUP
name: dererpost
So, the above is all fine, both Generic_Output and dererpost switches on when the nodemcu is power up. I can see they are on in lovelace and in the log.
Now, here is the automation that I can not get to work, no matter if I try with Generic_Output or dererpost. I simply do not get a notification. It works fine if I press Execute (the reason why I switch of the switch is to unlatch the power circuit so the ESP goes back to sleep). Any takes on why I do not get a notification if Generic_Output or dererpost are on?
- id: '1590151128548'
alias: notify when mail
description: ''
trigger:
- device_id: 6ae55cdb0f534d9e9139f5d6c2f44cf5
domain: binary_sensor
entity_id: binary_sensor.dererpost
platform: device
type: turned_on
condition: []
action:
- data:
message: Der er post
service: notify.mobile_app_mi_mix_2
- device_id: 6ae55cdb0f534d9e9139f5d6c2f44cf5
domain: switch
entity_id: switch.generic_output
type: turn_off