I have just tried to add the extra line and it wont allow me to upload, is it my syntax that is not correct?
I am sorry, deep_sleep does not have that parameter. I got confused. You donât need that. Thanks
because when the engine is running the alternator engages and supplies electricity to the electrical system. When the car is off, then any active device pulls power from whatever charge is stored in the battery.
Thank you once again I now have all 3 cars with devices on. I have added an automation to notify via the app and Alexa when the voltage drops below 12 Volts.
Is there any way to display the voltages in a gauge ? So the last reading can be seen all the time, Rather than having to click on the Devices voltage field in a glance card. Using the gauge card returns âEntity is non-numeric: sensor.voltage_2â
Thanks
I think that you are trying to read the sensor from the node on EspHome. In this case, since you are using deep sleep, you need to read the mqtt sensor on HA.
- platform: mqtt
name: Battery Voltage
state_topic: "battery_voltage/sensor/voltage/state"
unit_of_measurement: 'V'
device_class: voltage
qos: 2
payload_available: "online"
payload_not_available: "offline"
thanks for being so helpful, yes I have been getting the senor data from Esp Home.
I have added the text to my config.yaml and get this error
bad indentation of a mapping entry at line 152, column 9:
name: Battery Voltage
^
This is one of my favorite integrations and with the situation with the cars not being driven alot at the moment a very practical one.
I would love to have the gauges working for display on my wall mounted tablet.
Thanks once again If you are able to help.
Philip,
You just need to check the indentation of the first line (platform). Make sure itâs correct in reference with the lines above it.
- platform: mqtt
Thank you so much for you help. It was a combination of the indentation and the fact I also had a sensor field higher up for the badnest, i placed the code under that and it was fine, I am still learning this yaml coding and with the help of people like yourself I am getting to understand it little by little. I presume, I just change the line to state_topic: âwhat i called the other sensors/sensor/voltage/stateâ
Great! I am glad I could help. We all are learning and itâs great to have a community to share our experiences/knowledge with other.
Thanks for this! Just waiting for my power shields and then Iâll build them!
Anyone tried adding a ds18b20 temp sensor to it? Just for the fun of it to get the interior car temp during winter to see if the heater is working
I had thought about that myself, but decided not to as I mounted all my units at within the engine bay to get a direct reading from the battery. My alarm keyfob also shows the internal temperature anyway, so I know its nice and warm/cold before getting in after a remote start.
Awsome, my old cars isnât that fancy
I think I have some with 1.5m cables around here somewhere, will add one just for the fun of it. Should be fine to push through some grommet between the engine bay and the car. Will report back when itâs done!
Thanks for your code and advice.
Am I right that this is so the wemos d1 can wake up from deep sleep? (indeed mine with your ESPHome code goes to deep sleep but does not wake up)
Am I also right that itâs no longer possible to program the wemos d1 after that connection, at least not via USB?
Just want to double check before I solder the pins
Yes, that is so that the D1 Mini can wake up from deep sleep. I have two devices that use deep sleep and they have been working without any problem for at least 5 months. The D1 mini should wake up.
In order to upload any code OTA, you can stop deep sleep on the D1 Mini. See the deep_sleep.prevent and deep_sleep.enter below under the MQTT section.
esphome:
name: ${devicename}
platform: ESP8266
board: d1_mini
deep_sleep:
run_duration: 60s
sleep_duration: 60min
id: battery_deep_sleep
mqtt:
broker: 192.168.XXXXXX
username: !secret mqtt_username
password: !secret mqtt_password
birth_message:
topic: battery_voltage/topic
payload: online
will_message:
topic: battery_voltage/topic
payload: offline
on_message:
- topic: deep_sleep/ota_mode
payload: 'ON'
then:
- deep_sleep.prevent: battery_deep_sleep
- topic: deep_sleep/ota_mode
payload: 'OFF'
then:
- deep_sleep.enter: battery_deep_sleep
I have an input boolean in HA. When I turn it off, it executes an automation and script to send an mqtt message to turn off deep sleep on my devices. The next time the D1 mini wakes up or if I reset it manually, it will not go to deep sleep.
These are the automations:
##############################################################
# DEEP SLEEP FOR ESPHOME DEVICES
##############################################################
- id: TurnOffDeepSleepForOTA
alias: Turn Off Deep Sleep For OTA
trigger:
platform: state
entity_id: input_boolean.deep_sleep
to: 'off'
action:
- service: script.turn_on
entity_id: script.stop_deep_sleep_on_esphome_devices
##############################################################
- id: TurnOnDeepSleepForOTA
alias: Turn On Deep Sleep For OTA
trigger:
platform: state
entity_id: input_boolean.deep_sleep
to: 'on'
action:
- service: script.turn_on
entity_id: script.resume_deep_sleep_on_esphomedevices
These are the scripts:
####################################################################
stop_deep_sleep_on_esphome_devices:
alias: Stop Deep Sleep
sequence:
- service: mqtt.publish
data:
topic: deep_sleep/ota_mode
payload: 'ON'
qos: 2
retain: true
- service: notify.mobile_app_my_iphone
data:
title: Deep Sleep
message: Deep sleep turned off for OTA updates
####################################################################
resume_deep_sleep_on_esphomedevices:
alias: Resume Deep Sleep
sequence:
- service: mqtt.publish
data:
topic: deep_sleep/ota_mode
payload: 'OFF'
qos: 2
retain: true
- service: notify.mobile_app_my_iphone
data:
title: Deep Sleep
message: Deep sleep turned on
####################################################################
Of course, you could have them combined instead of separated in automations/scripts.
I would not solder anything until you have tested that everything is working.
I hope this helps.
Thanks a lot for the explanation and all details
Will d1 mini run if i use one 1.5M ohm resistor instead of 1.44M ohm resistor one 1M ohm+220k ohm is it not 1,22MOhm?
The D1 mini has a built in 220k , so in total youâll get 1M + 220k + 220k = 1.44M
I canât see why it would not work, the idea of the 1.44 was that it would handle up to 16V input without burning the A0.
Thx did order som resistors whit 1m ohm and 220k ohm did not have so hi resitors home. Have 3 sensors 2 in cars and one in the caravan and it works perfect
Does anyone with better knowledge than me , know why after changing from my isp wifi and changing to unifi equipment (yet another rabbit hole) the D1s dont always connect to report the voltage. They worked 98% of the time before. I have created a 2.4 access point just from my Home automation, and used a new SSID, and re-flashed the D1s with the new details. When they do connect they have very good signal strength. One of my cars has not reported back now in 2 days? I am thinking it must be down to the unifi setup, but I have no issues with anything else (The D1s have static ip in the programming).