It’s good to see I’m not the only one who finds the generic_thermostat pretty useless. I’ve been forcing myself to continue using it thinking that “doing it myself” would be more cumbersome. But, in the end, I’m basically doing it myself anyway.
For me, each room has a desired temperature for when it’s occupied, but I don’t need different away temps for each room. So each room turns on an input boolean when it wants heat (or air conditioning) and then an automation interprets all the input booleans to determine if the heat actually needs to be on or not.
I see that you have sliders/input_numbers to set climate in each room. Do you have a generic_thermostat that gets adjusted with each of these or are you just using the input_numbers and automations?
Automations. The input numbers determine if the heating/cooling device should be turned on. Then the actual thermostat used to control the room temperature is the thermostat in the equipment not HA.
My mailbox setup is very similar. It’s a NodeMCU-32S running ESPhome that has two reed switches. One for the letter slot lid and one for the letter retrieval door. It spends the majority of the time asleep. It wakes up for a couple of minutes every 12 hours to send wifi and battery state, or when either of the reed switches change state.
If 14 hours go by without getting a status update I get a lost connection alert from HA.
A signal from the slot = mailbox full, signal from the door = mailbox empty.
It’s powered by a single 18650 Li cell, 4.2V regulator and 6V 3.5W solar panel. So far (summer) the battery voltage has not deviated from 4.16V, day or night. I over engineered it a bit but the real test will be winter. Being this far south the day length gets very short, overcast and the panel is facing the wrong way for this hemisphere. We shall see in another 4 months or so how good my estimates and fudge factors were.
I’ve used this exact same circuit with one limit switch to monitor a boundary gate.
I tried a few (much) cheaper ebay solar panels but found they all lie about their power output. The worst one was a supposed 5V 5W panel that put out 250mW. So yeah, if anyone else is going to build something like this ‘caveat emptor’ when dealing with Chinese solar panels on ebay. Spend your money at a reputable supplier.
Very nice indeed, I like this in particular because it uses the states ui (old ui) which I desperately need because of my older ipads not supporting custom lovelace cards.
I will follow this thread and watch for the code (as I might use a bit in my own setup).
I got as far as this after 6 months of Home Assistant and always looking for new ideas:
Look for magnetic reed switches with both NO (normally open) and NC (normally closed) contacts. Connect to the NC contacts. So the switch is open when the magnet is close. This will reduce the sleep current.
The header pins for the ESP board do not bring pins GPIO14 or GPIO32 to the Veroboard. If you do this they will short out.
There is a two pin header on the edge of the board you can short out to keep the board awake for testing / OTA updates. Alternatively just short either the door or lid sensors wires (i.e. open the lid or door).
ESPhome now supports multiple wake pins for the ESP32 so you don’t have to do it this way and it can be considerably simplified. No need for the diodes or R17 or configuration for GPIO12. Just set the wakeup pin to GPIO25 and GPIO26.
A good quality 2200mAh 4.2V 18650 Li cell should run this for months. Get one with a built in battery protection circuit to prevent over discharging and damaging your battery.
#################################################################
## Mailbox Automations
#################################################################
- id: mail_arrived_alert
alias: 'Mail Arrived Alert'
trigger:
platform: state
entity_id: binary_sensor.mailbox
to: 'on'
action:
- service: notify.all_ios_devices
data:
message: Snail-mail has arrived.
data:
push:
sound: "MailArrived.wav"
- id: mailbox_full
alias: 'Mailbox Full'
hide_entity: true
initial_state: true
trigger:
platform: state
entity_id: binary_sensor.mailbox_lid
to: 'on'
action:
service: mqtt.publish
data_template:
payload: "ON"
topic: 'home-assistant/variable/mailbox'
retain: true
- id: mailbox_clear
alias: 'Mailbox Clear'
hide_entity: true
initial_state: true
trigger:
platform: state
entity_id: binary_sensor.mailbox_door
to: 'on'
action:
service: mqtt.publish
data_template:
payload: "OFF"
topic: 'home-assistant/variable/mailbox'
retain: true
- id: mailbox_connection_monitor
alias: 'Mailbox Connection Monitor'
trigger:
platform: state
entity_id: binary_sensor.mailbox_status
to: 'off'
for:
hours: 14
action:
- service: notify.ios_iphonex
data:
message: Communication lost to mailbox sensor.
data:
push:
sound: "Attention.wav"
- id: mailbox_battery_monitor
alias: 'Mailbox Battery Monitor'
trigger:
platform: numeric_state
entity_id: sensor.mailbox_battery
below: 3.3 # any lower than this and the ESP may reset
action:
- service: notify.ios_iphonex
data_template:
message: Mailbox battery low volatage {{ states('sensor.mailbox_battery') }}.
data:
push:
sound: "Attention.wav"
I just added the battery monitor. Not sure if it will alart me when the sensor becomes unavailable. It spends 99% of it’s time in this ‘unavailable’ state (only waking up to report twice a day or if the reed switches activate).
I finally found the limits of my Pi 3b. I was prettying up the admin stats as shown below but this has resulted in regular periods of 5 or so seconds when the front end becomes unresponsive.
I’m guessing the bottleneck is SD card read speed. Which should be rectified by the arrival of my mini PC in the next week or so.
EDIT: Actually the pi was still very responsive to automated actions. A bit further investigation revealed Firefox was using 6GB of RAM. Restarting the browser has returned full responsiveness. The Pi really is amazing.
A quick question about your WiFi Levels gauges. Are any of your devices ever off line (either by design or by accident)? If so how do you handle that in Lovelace to stop big red boxes?
Yes, the mailbox and gate sensors spend 99.9% of their time asleep and thus off-line. I simply dont send LWT (last will and testament) mqtt messages so they never appear as offline.
As well as when they are tripped, they wake up every 12 hours to send battery levels. If I dont hear from them for 14 hours I get an alert.
Thanks for posting your awesome installation. I think the real benefit to Node RED is speed of implementing and testing new ideas. I’ve waited a long time for something as cool as Node RED. (the first program I ever wrote was in FORTRAN on punchcards).
I’m getting this error in my logs for all the buttons I set up for my remotes. Everything still works but every time I press a button it triggers the following log entry. Any idea what is going on?
Not passing an entity ID to a service to target all entities is deprecated. Update your call to remote.send_command to be instead: entity_id: all