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

furpile

Expert Member
Joined
Jul 14, 2014
Messages
4,283
Is this from a Sonoff POW2?
POW R2 yes. I just created a sensor for each value in my config file, and then plotting the history on the dashboard. Haven't done the InfluxDB/Grafana thing so no fancy graphs yet. Not sure if it is worth it for me yet, at this stage I am just monitoring to figure out if automation will work.
 

Speedster

Honorary Master
Joined
May 2, 2006
Messages
21,675
POW R2 yes. I just created a sensor for each value in my config file, and then plotting the history on the dashboard. Haven't done the InfluxDB/Grafana thing so no fancy graphs yet. Not sure if it is worth it for me yet, at this stage I am just monitoring to figure out if automation will work.
Tasmota of SonofLAN?
 

MidnightZA

Expert Member
Joined
Mar 9, 2013
Messages
2,452
Is it better to keep on standard of connection (RF/Zigbee/wifi)?

Which is the most practical? I would assume is dependent on application. In my case my entire house has very good wifi signal.
Would wifi switches be best in my case?

EDIT: Since Im still planning, Id like to get my devices/switches correct from the start
 

furpile

Expert Member
Joined
Jul 14, 2014
Messages
4,283
Tasmota of SonofLAN?
Just SonoffLAN. This is in my config file, no other settings.

Code:
sensor:
  - platform: template
    sensors:
      pool_power:
        friendly_name: 'Pool Power'
        unit_of_measurement: 'W'
        value_template: "{{ state_attr('switch.sonoff_1000fxxxxx', 'power') }}"

In Lovelace I just add a history graph card for each sensor.
 

furpile

Expert Member
Joined
Jul 14, 2014
Messages
4,283
Take a look at this config file of mine:

1st use the "integration" sensor. https://github.com/tinuva/home-assistant-config/blob/master/packages/power_sensors.yaml#L30
this converts the realtime Watt to Wh or you will see in my case kWh.

2nd use the utility meter: for daily: https://github.com/tinuva/home-assistant-config/blob/master/packages/power_sensors.yaml#L87
This records a daily and you can also do a monthly one. Basically it counts up and only resets per day or per month.

Those then create entities which I use in lovelace.
Thanks for this info, I wasn't sure yet how to add up the consumption per day/month. This will help a lot.
 

Sparkz0629

Expert Member
Joined
Jan 7, 2010
Messages
1,530
View attachment 1034540

Speaking of "promiscuous", this woman is freaking me out, staring at me like this the whole time... WTH FNB?!

In automations:

Code:
- id: Hass Startup Notification
  alias: Hass Startup Notification
  trigger:
  - platform: homeassistant
    event: start
  action:
    service: notify.mobile_app_eben_s_iphone_11
    data:
      title: Home Assistant
      message: Home Assistant was started




- id: Hass Shutdown Notification
  alias: Hass Shutdown Notification
  trigger:
  - platform: homeassistant
    event: shutdown
  action:
    service: notify.mobile_app_eben_s_iphone_11
    data:
      title: Home Assistant
      message: Home Assistant was shut down

The only problem with this is it doesn't account for when there is an unexpected outage, like power outage, internet outage etc,

I use https://uptimerobot.com/ for this, and it works great.
Simply give it your externally available link, and it will check it for you every 5 minutes and send you an alert via telegram etc if it goes down, and then also when it comes back up.

Definitely not to replace your automations, but rather as an additional step in your monitoring flow.
 

Tinuva

The Magician
Joined
Feb 10, 2005
Messages
12,474
Is it better to keep on standard of connection (RF/Zigbee/wifi)?

Which is the most practical? I would assume is dependent on application. In my case my entire house has very good wifi signal.
Would wifi switches be best in my case?

EDIT: Since Im still planning, Id like to get my devices/switches correct from the start
Zigbee is great for sensors, like Temp+Humidity, Door or Window, Buttons to trigger stuff in HA etc. Zigbee batteries last 3+ years.

Light/Plug switches I would keep on wifi, like the shelly and sonoff switches. These won't last long on batteries so they usually powered.

RF depends, I don't have much use for this, but maybe if you want a door bell button it could work.
 

Speedster

Honorary Master
Joined
May 2, 2006
Messages
21,675
Just SonoffLAN. This is in my config file, no other settings.

Code:
sensor:
  - platform: template
    sensors:
      pool_power:
        friendly_name: 'Pool Power'
        unit_of_measurement: 'W'
        value_template: "{{ state_attr('switch.sonoff_1000fxxxxx', 'power') }}"

In Lovelace I just add a history graph card for each sensor.
Nice. I simply added the config lines as above (using my ewelink credintials) and it picked up all my sonoff devices. Also I've added cards to lovelace but they look like this:
Screenshot 2021-05-11 at 15.43.33.png

Clicking on the card displays this:
Screenshot 2021-05-11 at 15.44.02.png

How can I get the second to be the default?
 

furpile

Expert Member
Joined
Jul 14, 2014
Messages
4,283
Nice. I simply added the config lines as above (using my ewelink credintials) and it picked up all my sonoff devices. Also I've added cards to lovelace but they look like this:
View attachment 1066517

Clicking on the card displays this:
View attachment 1066523

How can I get the second to be the default?
Is the first one the history graph card? Mine looked like that by default, although there is 1 or 2 updates I still need to install. Something may have changed. This is how I add the card:
1620741172747.png
 

Tinuva

The Magician
Joined
Feb 10, 2005
Messages
12,474

Veroland

Executive Member
Joined
Aug 24, 2005
Messages
6,304
Nice. I simply added the config lines as above (using my ewelink credintials) and it picked up all my sonoff devices. Also I've added cards to lovelace but they look like this:
View attachment 1066517

Clicking on the card displays this:
View attachment 1066523

How can I get the second to be the default?
You can always look at influxDB and grafana if you want to get snazzy graphs
 

Tinuva

The Magician
Joined
Feb 10, 2005
Messages
12,474
You can always look at influxDB and grafana if you want to get snazzy graphs
I have to admit, I have grafana set up. However, I prefer looking at HA when not infront of a pc.

When I had an issue, and my installer blamed my DoD settings, the Grafana graphs were epic. I just sent a few screenshots from grafana to give proof that the inverter and batteries and not showing the same charge %. So for digging into the history, nothing will beat grafana. But HA views stay tops for when I am not at my pc.

So both is important. I do think there is a usecase for getting the graphs the way he wants them to look in HA. That custom card is what I think will get him there.
 

Veroland

Executive Member
Joined
Aug 24, 2005
Messages
6,304
I have to admit, I have grafana set up. However, I prefer looking at HA when not infront of a pc.

When I had an issue, and my installer blamed my DoD settings, the Grafana graphs were epic. I just sent a few screenshots from grafana to give proof that the inverter and batteries and not showing the same charge %. So for digging into the history, nothing will beat grafana. But HA views stay tops for when I am not at my pc.

So both is important. I do think there is a usecase for getting the graphs the way he wants them to look in HA. That custom card is what I think will get him there.
One of the next things I wan't play with is the grafana image renderer to see if I can add the fraphs to HA.

I just need the time
 

Veroland

Executive Member
Joined
Aug 24, 2005
Messages
6,304
So for all the electricity consumption experts I have a dumb question.

How does kWh equates to the prepaid units you buy?
 
Top