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

MidnightZA

Expert Member
Joined
Mar 9, 2013
Messages
2,452
So only notify it it changed and stayed like that for at least 5 seconds. You can do it longer or shorter, depends on how many seconds between your armed->disarmed->armed. But basically it will only notify once if you do that for both the arm and disarmed triggers. The side effect is, the notification will be delayed by at least that long.
Thanks. I will see how this addition works over the next few days.

I delayed my exterior by 2 seconds (since its only that partition that gives the issue). The notifications usually come all at once. I think even a 1 second delay will work.
 

MidnightZA

Expert Member
Joined
Mar 9, 2013
Messages
2,452
Another question. If I create a snapshot of my setup, (Pi3B+ with SD card). Can that snapshot be restored seamlessly to a Pi4 with SSD?
If not, what is the correct way to transfer my whole HA over to the new system? Im not to keen on restarting everything from scratch lol
 

Veroland

Executive Member
Joined
Aug 24, 2005
Messages
6,304
Another question. If I create a snapshot of my setup, (Pi3B+ with SD card). Can that snapshot be restored seamlessly to a Pi4 with SSD?
If not, what is the correct way to transfer my whole HA over to the new system? Im not to keen on restarting everything from scratch lol

It worked for me with no issues. I just killed the pi3 first and set the pi4 to use the ip the pi3 had before restoring
Edit: I also checked that my Zigbee sniffer was picked up on the same port as the pi3 but it was so I had no config changes there.
 

MidnightZA

Expert Member
Joined
Mar 9, 2013
Messages
2,452
It worked for me with no issues. I just killed the pi3 first and set the pi4 to use the ip the pi3 had before restoring

Thanks. I actually didn't think about the IP. That would save me some hair pulling when my Pi4 arrives one of the day
 

Speedster

Honorary Master
Joined
May 2, 2006
Messages
21,675
I'm pretty proud of myself, in the past week I've set up HA, enabled remote access (DuckDNS with TLS), got the telegram bot working (both notifications and executing commands), changed weather to OpenWeather and have just moved my sonoff pool pump and CBI geyser schedules to HA (stopped their cloud schedules). I've also got the display showing my house's power consumption from the efergy, together with the geyser and pool. Banggood just let me know my package is coming today, so this weekend I'll be hooking up my alarm system. Whoop whoop.

It has begun.png
 

Veroland

Executive Member
Joined
Aug 24, 2005
Messages
6,304
I'm pretty proud of myself, in the past week I've set up HA, enabled remote access (DuckDNS with TLS), got the telegram bot working (both notifications and executing commands), changed weather to OpenWeather and have just moved my sonoff pool pump and CBI geyser schedules to HA (stopped their cloud schedules). I've also got the display showing my house's power consumption from the efergy, together with the geyser and pool. Banggood just let me know my package is coming today, so this weekend I'll be hooking up my alarm system. Whoop whoop.
Cool, looks nice.

I have a extra sonoff POW R2, will that be fine to hook up to the pool pump?
 

Speedster

Honorary Master
Joined
May 2, 2006
Messages
21,675
Cool, looks nice.

I have a extra sonoff POW R2, will that be fine to hook up to the pool pump?
I've been running my powR2 on the pool for about 3 months without issues. The switch is rated at 15A, but my 1kw pump only pulls about 4.5A so it is well within spec.
 

Speedster

Honorary Master
Joined
May 2, 2006
Messages
21,675
Like this:

How many sensors can connect to a hub?
Yes, that's the one. I'm not sure what the max number of transmitters is per hub though. I have an E2 classic, three phase which takes three CT sensors although it exports a single value output (i.e. can't differentiate between the phases)
 

Speedster

Honorary Master
Joined
May 2, 2006
Messages
21,675
Just a small comment on how you are accessing entities and their attributes. It is advised at https://www.home-assistant.io/docs/configuration/templating/ that you rather use:
YAML:
{{ state_attr('switch.geyser', 'current') }}
Have a look at the warning under STATES.
Updated as requested ;)

- platform: template
sensors:
geyser_voltage:
value_template: >-
{{ state_attr('switch.geyser', 'voltage') }}
unit_of_measurement: "V"
friendly_name: Geyser voltage
geyser_current:
value_template: >-
{{ state_attr('switch.geyser', 'current') }}
unit_of_measurement: "mA"
friendly_name: Geyser amps
geyser_consumption:
value_template: >-
{{ state_attr('switch.geyser', 'current_consumption') }}
unit_of_measurement: "W"
friendly_name: Geyser verbruik
 

Speedster

Honorary Master
Joined
May 2, 2006
Messages
21,675

Tinuva

The Magician
Joined
Feb 10, 2005
Messages
12,474
It working now as is, but for completeness sake, how would I get tuya local to create the sensors for me?
Ok making this up based on the localtuya git repo.

Code:
localtuya:
  - host: 192.168.241.150
    device_id: !secret geyser_mainbathroom_device_id
    local_key: !secret geyser_mainbathroom_local_key
    friendly_name: Main Bathroom Geyser
    protocol_version: "3.3"
    entities:
      - platform: switch
        friendly_name: Main Bathroom Geyser
        id: 1
        #current: 21
        #voltage: 22
        #current_consumption: 23
      - platform: sensor
        friendly_name: Geyser Current
        id: 21
        device_class: current # Optional
        unit_of_measurement: "A" # Optional
      - platform: sensor
        friendly_name: Geyser Voltage
        id: 22
        device_class: voltage # Optional
        unit_of_measurement: "V" # Optional
      - platform: sensor
        friendly_name: Geyser Power
        id: 23
        device_class: energy # Optional
        unit_of_measurement: "W" # Optional

Device class is from HA Docs.
 

Tinuva

The Magician
Joined
Feb 10, 2005
Messages
12,474
You may need to add a line like ` scaling: 0.1 # Optional` to change the scaling to the correct level. Something to test. No idea what it should be, to get the values to look proper. I see in template I only divided the current by a 1000.
 

Speedster

Honorary Master
Joined
May 2, 2006
Messages
21,675
Ok making this up based on the localtuya git repo.

Code:
localtuya:
  - host: 192.168.241.150
    device_id: !secret geyser_mainbathroom_device_id
    local_key: !secret geyser_mainbathroom_local_key
    friendly_name: Main Bathroom Geyser
    protocol_version: "3.3"
    entities:
      - platform: switch
        friendly_name: Main Bathroom Geyser
        id: 1
        #current: 21
        #voltage: 22
        #current_consumption: 23
      - platform: sensor
        friendly_name: Geyser Current
        id: 21
        device_class: current # Optional
        unit_of_measurement: "A" # Optional
      - platform: sensor
        friendly_name: Geyser Voltage
        id: 22
        device_class: voltage # Optional
        unit_of_measurement: "V" # Optional
      - platform: sensor
        friendly_name: Geyser Power
        id: 23
        device_class: energy # Optional
        unit_of_measurement: "W" # Optional

Device class is from HA Docs.
Where would I find the yaml in which the existing local tuya config has been done (setup via the integration)? It's not in the configuration.yaml
 

Tinuva

The Magician
Joined
Feb 10, 2005
Messages
12,474
Where would I find the yaml in which the existing local tuya config has been done (setup via the integration)? It's not in the configuration.yaml
That wont be in yaml at all. Its in a hidden folder in a complex json file.

edit: you will find it in .storage/core.config_entries but don't edit that file manually.
 
Last edited:

deesef

Expert Member
Joined
Mar 3, 2017
Messages
2,627
I'm pretty proud of myself, in the past week I've set up HA, enabled remote access (DuckDNS with TLS), got the telegram bot working (both notifications and executing commands), changed weather to OpenWeather and have just moved my sonoff pool pump and CBI geyser schedules to HA (stopped their cloud schedules). I've also got the display showing my house's power consumption from the efergy, together with the geyser and pool. Banggood just let me know my package is coming today, so this weekend I'll be hooking up my alarm system. Whoop whoop.

View attachment 1067657
I have mainly Sonoff devices on my HA. After some deliberation, I decided to keep the ewelink app active as a backup for if / when my local server may be offline for whatever reason. It costs nothing (tangible) and may just save some heartache one day.

PS: if you don't mind me asking, what are you getting from bangood? I have bought most of my ha stuff from them.
 

MidnightZA

Expert Member
Joined
Mar 9, 2013
Messages
2,452
Is banggood a reliable and good source of HA items? Are the stuff there much cheaper?

I see a lot of people ordering from there
 
Top