Home Assistant : Q&A, Tips & Tricks, Your Configs

Speedster

Honorary Master
Joined
May 2, 2006
Messages
17,598
I'm planning to put our borehole on a POW R2 over the weekend and began prepping my HA for this. I've set up a timer where I can select how long the switch should run for but would like to have a card show the remaining time. Anyone know how this card could be done?
 

Tinuva

The Magician
Joined
Feb 10, 2005
Messages
11,225
I'm planning to put our borehole on a POW R2 over the weekend and began prepping my HA for this. I've set up a timer where I can select how long the switch should run for but would like to have a card show the remaining time. Anyone know how this card could be done?
Just add the timer entity any way you like.

Screenshot 2021-11-17 at 11.15.21.png

I only want to see active timers, so my card looks like this:
Code:
card:
  show_header_toggle: false
  title: Timers
  type: entities
filter:
  exclude:
    - state: idle
    - entity_id: timer.88e9fe88abfe
  include:
    - entity_id: timer*
show_empty: false
type: custom:auto-entities
 

Speedster

Honorary Master
Joined
May 2, 2006
Messages
17,598
Just add the timer entity any way you like.

View attachment 1194646

I only want to see active timers, so my card looks like this:
Code:
card:
  show_header_toggle: false
  title: Timers
  type: entities
filter:
  exclude:
    - state: idle
    - entity_id: timer.88e9fe88abfe
  include:
    - entity_id: timer*
show_empty: false
type: custom:auto-entities
I've set the timer up, I'm looking for a way to display the time remaining. Oh wait, I missed that part in your post. Let me try that.
 

w1tw0lf

Expert Member
Joined
Sep 29, 2009
Messages
1,069
Have a look if there isn't an attribute to the timer that has remaining time, like here:

cbf6d93463e40671e4a656bcaff724a521c872c0.png


PS: Got the image of google :p
 

Tinuva

The Magician
Joined
Feb 10, 2005
Messages
11,225
Have a look if there isn't an attribute to the timer that has remaining time, like here:

cbf6d93463e40671e4a656bcaff724a521c872c0.png


PS: Got the image of google :p
Lovelace automatically shows the time remaining if the timer is active. No need to specify you want to show the attribute.

edit:
except in a glance card...then it shows "active" =/
 

Speedster

Honorary Master
Joined
May 2, 2006
Messages
17,598
Just add the timer entity any way you like.

View attachment 1194646

I only want to see active timers, so my card looks like this:
Code:
card:
  show_header_toggle: false
  title: Timers
  type: entities
filter:
  exclude:
    - state: idle
    - entity_id: timer.88e9fe88abfe
  include:
    - entity_id: timer*
show_empty: false
type: custom:auto-entities
What do you use to keep track of the remaining time?
 

MidnightZA

Expert Member
Joined
Mar 9, 2013
Messages
2,013
1637141808767.png

With the one of the November updates, the icons were changed.
Any idea how I can remove the text from the red "Armed Away" icon?

Previously it was just the shield icon without the text. Armed was red and Unarmed was green. The text makes it look cluttered
 

Speedster

Honorary Master
Joined
May 2, 2006
Messages
17,598
Lovelace automatically shows the time remaining if the timer is active. No need to specify you want to show the attribute.

edit:
except in a glance card...then it shows "active" =/
Mine doesn't :confused:

Here's the code for the timer:
# Input for timer
input_number:
button_timer_minutes:
name: "Timer"
min: 0
max: 300
step: 5
input_boolean:
button_timer_enabled:
name: "Timer switch"
initial: off
icon: mdi:timer-sand

#Timer switch
- id: "000016"
alias: "Timer"
trigger:
platform: state
entity_id: input_boolean.button_timer_enabled
to: 'on'
action:
- service: switch.turn_on
entity_id: switch.pool
- delay:
minutes: "{{ states('input_number.button_timer_minutes') | int }}"
- service: switch.turn_off
entity_id: switch.pool

timer button.png
 

Tinuva

The Magician
Joined
Feb 10, 2005
Messages
11,225
Mine doesn't :confused:

Here's the code for the timer:


View attachment 1194670
I don't see timer code there?

Timer entities start with `timer.`

You need to create an actual timer like so in yaml first:
Code:
# Example configuration.yaml entry
timer:
  laundry:
    duration: "00:01:00"
duration is optional and can be set when you start the timer. Though its good to have one here.

Also, you not doing a timer, you doing a delay which is horrible. You can't see the countdown time time on that.

See: https://www.home-assistant.io/integrations/timer/

1. Create a timer.
2. In your automation id: "000016"/alias: "Timer" you need need to call the service to start the timer after turning on the POW R2
3. Create another automation, that is triggered by the timer finishing, which then turns off your POW R2.

Then go add the timer entity in lovelace.

Keep in mind, if you restart HA during the timer being active, the countdown time is lost. So have a backup automation that can turn of the POW R2 in case it was on for X minutes and timer is not active.
 

MidnightZA

Expert Member
Joined
Mar 9, 2013
Messages
2,013
View attachment 1194654

With the one of the November updates, the icons were changed.
Any idea how I can remove the text from the red "Armed Away" icon?

Previously it was just the shield icon without the text. Armed was red and Unarmed was green. The text makes it look cluttered

Anyone?

Also, I remember seeing a post about a light/pulse counter to monitor a prepaid meter using the flashing light and ESPhome? Anyone have any idea where that post is? I've been trying to find it but I'm using the wrong search terms
 

AfricanTech

Honorary Master
Joined
Mar 19, 2010
Messages
38,242
The latest November update also messed up Tuya V2, now noticing considerable lag between button presses and actions. Statuses are also not updating timeously

I lost a a full page of LL cards

fortunately my backup was good - rolled back successfully
 

furpile

Expert Member
Joined
Jul 14, 2014
Messages
3,736
Anyone?

Also, I remember seeing a post about a light/pulse counter to monitor a prepaid meter using the flashing light and ESPhome? Anyone have any idea where that post is? I've been trying to find it but I'm using the wrong search terms
This is an interesting alternative I found. Using an ESP32 camera to take photos of the meter and then read the meter numbers from that. Very neat solution.

 

tRoN

Executive Member
Joined
Mar 13, 2007
Messages
6,608
View attachment 1194654

With the one of the November updates, the icons were changed.
Any idea how I can remove the text from the red "Armed Away" icon?

Previously it was just the shield icon without the text. Armed was red and Unarmed was green. The text makes it look cluttered


Which alarm and integration you using ?
How did you get the battery voltage indicator ?
 

MidnightZA

Expert Member
Joined
Mar 9, 2013
Messages
2,013
Which alarm and integration you using ?
How did you get the battery voltage indicator ?

I have a Paradox EVO192 with the pai integration.

I made a voltmeter for the battery. I used a voltage adc sensor module, 12v to 5v buck converter and a d1 mini.

Screenshot_20211120-074313_WhatsApp.jpg

Edit: not to double post
This is an interesting alternative I found. Using an ESP32 camera to take photos of the meter and then read the meter numbers from that. Very neat solution.


That is quite interesting. I think I'll order an esp32 cam with my next BG order.
 
Last edited:

Speedster

Honorary Master
Joined
May 2, 2006
Messages
17,598
I don't see timer code there?

Timer entities start with `timer.`

You need to create an actual timer like so in yaml first:
Code:
# Example configuration.yaml entry
timer:
  laundry:
    duration: "00:01:00"
duration is optional and can be set when you start the timer. Though its good to have one here.

Also, you not doing a timer, you doing a delay which is horrible. You can't see the countdown time time on that.

See: https://www.home-assistant.io/integrations/timer/

1. Create a timer.
2. In your automation id: "000016"/alias: "Timer" you need need to call the service to start the timer after turning on the POW R2
3. Create another automation, that is triggered by the timer finishing, which then turns off your POW R2.

Then go add the timer entity in lovelace.

Keep in mind, if you restart HA during the timer being active, the countdown time is lost. So have a backup automation that can turn of the POW R2 in case it was on for X minutes and timer is not active.
Thanks. This helps a lot, but I can't figure out how to set the duration for a timer via a lovelace card?
 
Top