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

w1tw0lf

Expert Member
Joined
Sep 29, 2009
Messages
1,083
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
Been using the https://github.com/klaasnicolaas/home-assistant-glow for few months and happy so far. Works as needed and gives accurate readings. So far it has been of with about 5 units on average. Just make sure photodiode is connect correctly as per the github and that it can't see any other light as it will effect it. Also there is a sensitivity adjustment that needs to be tweaked on the photodiode.
 

Speedster

Honorary Master
Joined
May 2, 2006
Messages
18,042
Needs a separate input, which you then pass as data when you start the timer.
I've tried using the same way I specified the delay duration previously, but I can't get timer to accept that as an input? #confused
 
Last edited:

Speedster

Honorary Master
Joined
May 2, 2006
Messages
18,042
Try numeric input and specify it as minutes
Here's what I've got currently, but it's not accepting the minutes:

# Timer
timer:
timer_test:
duration:
hours: 00
minutes: "{{ states('input_number.button_timer_minutes') | int }}"
seconds: 00
icon: mdi:timer-sand

# Input for timer
input_number:
button_timer_minutes:
name: "Timer"
initial: 0
min: 0
max: 300
step: 5
 

Tinuva

The Magician
Joined
Feb 10, 2005
Messages
11,363
Here's what I've got currently, but it's not accepting the minutes:
No that will not work.

Remove the duration on the timer.

In your automation, when you call start timer service, as data send the input.
 

MidnightZA

Expert Member
Joined
Mar 9, 2013
Messages
2,075
Been using the https://github.com/klaasnicolaas/home-assistant-glow for few months and happy so far. Works as needed and gives accurate readings. So far it has been of with about 5 units on average. Just make sure photodiode is connect correctly as per the github and that it can't see any other light as it will effect it. Also there is a sensitivity adjustment that needs to be tweaked on the photodiode.

How do you power your rig? I have a plug point about 3m away from the DB/prepaid meter, but I dont want any cables running along the wall for 3m.

And, do you have the RGB LED like in the link?
 

w1tw0lf

Expert Member
Joined
Sep 29, 2009
Messages
1,083
How do you power your rig? I have a plug point about 3m away from the DB/prepaid meter, but I dont want any cables running along the wall for 3m.

And, do you have the RGB LED like in the link?
Mine is power by normal usb charger at the moment. Is temporary at the moment as just wanted to get better idea of usage over few months to decide on solar.

I didn't have the exact one that is shown in the link. Tried with https://www.robotics.org.za/2535?search=rgb le which worked, but removed it as it interfered with the photodiode. Photodiode also has a led on that flashed when detected, used that to tweak the sensitivity
 

Speedster

Honorary Master
Joined
May 2, 2006
Messages
18,042
No that will not work.

Remove the duration on the timer.

In your automation, when you call start timer service, as data send the input.
Thanks. Feels like I'm almost there now, but still missing something.

configuration.yaml
# Timer
timer:
timer_test:
icon: mdi:timer-sand
# Input for timer
input_number:
button_timer:
name: "Timer"
initial: 0
min: 0
max: 300
step: 5
input_boolean:
button_timer_enabled:
name: "Timer switch"
initial: off
icon: mdi:timer-sand

automations.yaml
#Timer switch
- id: "000016"
alias: "Timer start"
trigger:
platform: state
entity_id: input_boolean.button_timer_enabled
to: 'on'
action:
- service: timer.start
entity_id: timer.timer_test
data_template:
- duration: "{{ states('input_number.button_timer') | int }}"
- service: switch.turn_on
entity_id: switch.pool
EDIT: SUCCESS. The rouge hyphen before the duration broke everything
 
Last edited:

Tinuva

The Magician
Joined
Feb 10, 2005
Messages
11,363
Try

duration: "{{ states('input_number.button_timer') | int * 60 }}"

That is to convert from seconds to minutes.
 

xrapidx

Honorary Master
Joined
Feb 16, 2007
Messages
39,584
Anyone have experience with jinja2, and could tell me how to get the string variable to resolve as json?

works:
Code:
{% set json_object = {"room":"bedroom","lights":[{"light_name":"lamp1"},{"light_name":"lamp2"}]}  %}

{% for light in json_object.lights %}
{{ light.light_name }}
{% endfor %}

but string variable doesnt - trying to figure out how to get the string variable to evaluate as json.
Code:
{% set json_string = '{"room":"bedroom","lights":[{"light_name":"lamp1"},{"light_name":"lamp2"}]}'  %}

{% for light in json_string.lights %}
{{ light.light_name }}
{% endfor %}

EDIT | from_json is what I was after.
 
Last edited:

xrapidx

Honorary Master
Joined
Feb 16, 2007
Messages
39,584
Anyone have a solution for Sonoff (Tasmota) devices that just drop off the wifi network and don't come back until a power off/on?

I've noticed I have one or two on the far side of my property that occasionally drop off - and don't come back online until a power cycle, I know its not the actual device as I've swopped them out and same thing.

Just noticed my wellpoint pump has been offline for three days.
 

calypso

Expert Member
Joined
Feb 10, 2009
Messages
1,787
Anyone have a solution for Sonoff (Tasmota) devices that just drop off the wifi network and don't come back until a power off/on?

I've noticed I have one or two on the far side of my property that occasionally drop off - and don't come back online until a power cycle, I know its not the actual device as I've swopped them out and same thing.

Just noticed my wellpoint pump has been offline for three days.
I reflashed one and that fixed it. If not, just replace.
 

furpile

Expert Member
Joined
Jul 14, 2014
Messages
3,816
Anyone have a solution for Sonoff (Tasmota) devices that just drop off the wifi network and don't come back until a power off/on?

I've noticed I have one or two on the far side of my property that occasionally drop off - and don't come back online until a power cycle, I know its not the actual device as I've swopped them out and same thing.

Just noticed my wellpoint pump has been offline for three days.
My SV on the garage door does the same, but I think it is the voltage that is the problem from the small batteries. We had a power failure for almost 2 days recently and that unit never came back on. Need to get into the wiring there to disconnect it sometime so that it powers back up again. All other units seem to be ok.
 

xrapidx

Honorary Master
Joined
Feb 16, 2007
Messages
39,584
Different topic, my Sonoff ZigBee bridge arrived - is the best approach to getting it cloud independant soldering some pins on and flashing with Tasmota?

(I currently have five Sonoff ZigBee humidity/thermometers)
 

calypso

Expert Member
Joined
Feb 10, 2009
Messages
1,787
Different topic, my Sonoff ZigBee bridge arrived - is the best approach to getting it cloud independant soldering some pins on and flashing with Tasmota?

(I currently have five Sonoff ZigBee humidity/thermometers)
No need to solder but do flash. It works great.
 
Top