What did you do to your Home Assistant today!

That reads very well.
I am a beginner in Home Assistant and would like to have the solar yield of 7 days sent to me by e-mail at the end of a week. What should the code look like?
I would be very pleased to receive feedback. Thank you very much.

Well you would need multiple parts to get that working.

You need an email notifier platform setup and working.

Then we need to know how you receive your solar data in Home Assistant?

Sensor names would be very helpful.

My solar forecast estimate for today and tomorrow comes from forecast solar -

To get a 7 day (weekly) yield you would want to set up a utility meter with a weekly reset cycle -

If you are using the cron style reset pattern - you would want to use

0 0 * * 0

that resets at midnight on Sunday.

I rewrote large swaths of code that underpin my dashboard behaviors to make it more efficient and easier to manage, also addressed some bugs I found in code I had written long ago, and updated a few automations to add things that the wife requested.

Now I’m about to start filming my last 2 videos for my Dashboard December series, and then I have such a long list of things to do I don’t even know where to start. Keep in mind that I need to film them all, as well - so one at a time…

Add UPS extended runtime battery to existing UPS, connect via USB to one of my servers and install/configure NUT, then integrate with Home Assistant.

Replace 2 of my 3 doorbells, one with Lorex, and one with Amcrest. Reconfigure BlueIris, Deepstack, and Home Assistant as required. Compare and contrast vs the existing Ubiquiti G4s I have, and choose a winner. Then replace the remaining 2 with the winner, and do all that stuff.

Replace half a dozen dumb switches with smart switches.

Rewire 2 rooms (unfinished) so there are neutrals in the box, and replace the fixtures in one room. Add smart switches.

Record a video about my whole home audio system (Yamaha/Klipsch), how I built it, how it’s wired/cabled, the scripts and automations and dashboards that go with it. Update code as needed, I wrote all this almost 2 years ago and have learned a LOT since then. Probably a more efficient way of doing some of it now.

Replace the lightbulb in mynightstand lamp with a smart bulb and add an Aqara switch on the nightstand. (hers is already done, of course - gotta keep the WAF high!)

Install a couple dozen contact sensors to complete my alarm system, then figure out how to add the pin pad to Home Assistant, and configure an alarm interface and all the automations.

Add a smart outlet to my cable modem so that I can “reboot” it via Home Assistant if I have connectivity issues.

Finish configuring the Home Assistant PC integration and write some automations to reboot my Blue Iris server and Plex server if either of them become unavailable via Uptime Kuma (already configured the integration on one server and tested manually to make sure it’s feasible). Also useful in the event of an extended power outage and the UPS is nearing the end of it’s capacity so that I can shut servers down cleanly.

Try to figure out a way to automate the rebooting of my thermostat. Every time I reboot Home Assistant, the thermostat refuses to reconnect using HomeKit until I pull it off the wall and put it back again - also known as “rebooting it”. I’m thinking I can probably put a Shelly relay on the C-wire from the furnace? Need more research.

Finish installing undercabinet LED lights in the kitchen, then install Shelly relays behind the switches and add them to HA (can’t use smart switches - the switches are black, so Shelly relays behind them was the only choice).

Try to figure out a way to control the gas fireplace in the family room from Home Asisstant. Currently there’s a lightswitch, but it’s just a dumb old-school lightswitch that completes a low-voltage circuit. No line voltage in the box at all.

Install an Aqara FP2 in the nursery and configure automations to alert us if our son manages to get himself out of his crib - that’s the purpose for the smart bubs in the nightstands - I want to turn them red if something is going on. The main bedroom lights would also come on full brightness to wake us. Part of these “baby automations” would also involve a contact sensor on the nursery door, and a handful of other things, but I have to put a bit of thought into them. Like, I’d like for the hallway light to turn on if the nursery door is opened after we’ve already gone to bed, but only if it’s opened from the inside? Probably combine the FP2 with the contact sensor or something. Not sure.

There’s more, but I think that’s it for now.

Any votes on where to start? LOL

2 Likes

All this as well as looking after a baby. Good luck!

You’re not kidding… Honestly, the YouTube channel keeps me motivated to keep doing more stuff to the house and learning new things. If not for that, I’d probably not have done anything this entire year. LOL

1 Like

You’ve got your hands full. I’ve been soong some clean up too, mostly automations. Still have some zwave stuff to install and got some led strips and diguno controllers, so I’ll be diving into the world of wled to replace some Kasa strips.

Also got a Lenovo p12 12.7" tablet for Xmas, so deciding if it’s going to replace my dashboard on my desk (10.5"), or the bigger wall mounted one in the main living area (15.6"). That’s going to require some dashboard tweaking to get the card sizes adjusted.

Got the first of the 2 videos shot & edited last night. Just published it.

Working on the last video of the year now.

2 Likes

I have set up the SMTP integration. Home Assistant receives the daily solar yield via the APsystems local API via sensor.apsystems_ez1_m_today_production. I also use Forecast Solar. I have just created the Utility meter with the input sensor Today_Production and the meter reset cycle Weekly. Where I really need support is setting up the automation rule. My goal is to receive the total yield kWh of the last 7 days summarized by mail.
If this works, I would like to do the same for the main electricity meter sensor. In other words, a comparison of solar yield and grid consumption.

alias: Solar Generation Notification
description: Weekly Solar Generation notification.
trigger:
  - platform: time
    at: "23:30:00"
    id: weekly_solar_notify
condition:
  - condition: time
    weekday:
      - sun
action:
  - choose:
      - conditions:
          - condition: trigger
            id:
              - weekly_solar_notify
        sequence:
          - service: notify.my_smtp_notify_service
            data:
              title: |
                Weekly Solar Generation Statistics
              message: >-
                Weekly Solar Generation: {{ states('sensor.utility_meter_weekly_generation') }} kWh


                {% set n = states('sensor.utility_meter_weekly_generation')|float(0) %}
                {% set y = state_attr('sensor.utility_meter_weekly_generation','last_period')|float(0) %}
                {% if n < y %}
                  -{{ ((y/n) * 100) }}%
                {% else %}
                  +{{ (((n/y) * 100) - 100)|round(2) }}%
                {% endif %}
mode: single

That’s the basics of it.

That will generate something like:

Weekly Solar Generation: 26.7 kWh
+17.85%

I make extensive use of flex-table-card for displaying tabular information from flood data to sports statistics. Flex table uses Javascript to format the content in the column cells. I found myself writing very large but repetitive templates. Like for NHL Strength of Schedule comparing every team record to the opponents record and displaying colored arrows to indicate who is the favorite. Well, it got so tiring considering the table is 7 days, Monday through Sunday with several columns getting these templates.

So I wrote a “plugins” method that allows you to create your own personal Javascript functions that can be exported from the plugins JS file and imported into flex table.

The card below was reduced from 7 days * 3 templates (21 templates) all very complicated and repetitive to 3 functions and one line implementation in the card.

Huge reduction in in repetitive code, easy changes that can be applied to all uses of the function (instead of modifying the same thing over and over).

Submitted to GITHUB as an enhancement. Anyone interested just comment or follow the GITHUB thread at:

Now I can do this:

          modify: |
            plugin.sosind(x,1)

Instead of this (and repeat it 7 times with different data)!

            if( (x[1] ) && ( parseFloat(2*x[1].team.wins +
            x[1].team.overtimeLosses) < parseFloat(2*x[0].team.wins +
            x[0].team.overtimeLosses )) ) {
                '<ha-icon icon="mdi:arrow-up" style="color:green;">';}
            else if( (x[1] ) && ( parseFloat(2*x[1].team.wins +
            x[1].team.overtimeLosses) > parseFloat(2*x[0].team.wins +
            x[0].team.overtimeLosses )) ) {
                '<ha-icon icon="mdi:arrow-down" style="color:red;">';}
            else if (! x[1]) {' ';} else {'<ha-icon icon="mdi:arrow-all"
            style="color:silver;">';}

By doing this written as one function, not 7 …

export function sosind(x, day){
    var cellstring = '';
    if( (x[day] ) && ( parseFloat(2*x[day].team.wins + x[day].team.overtimeLosses) < parseFloat(2*x[0].team.wins + x[0].team.overtimeLosses )) ) {
        cellstring = '<ha-icon icon="mdi:arrow-up" style="color:green;">';}
    else if( (x[day] ) && ( parseFloat(2*x[day].team.wins + x[day].team.overtimeLosses) > parseFloat(2*x[0].team.wins + x[0].team.overtimeLosses )) ) {
        cellstring = '<ha-icon icon="mdi:arrow-down" style="color:red;">';}
    else if (! x[day]) {
        cellstring = ' ';}
    else {
        cellstring = '<ha-icon icon="mdi:arrow-all" style="color:silver;">';}
    return cellstring;
}
1 Like

All today?

Gotta read the whole post, man… That’s my “to-do” list, and of course it’s not all today. LOL Today is finishing the last video for Dashboard December.

That big list of stuff is all stuff that’s been hanging out, waiting for me to dedicate time to it. :frowning:

I get that, sorry for my poor attempt at humour :blush:

1 Like

Bah, it was probably me. Just stressed trying to get things done at the last minute. :frowning:

You’re running out of this year. Have a good one : :relieved:

1 Like

So, I did end up getting that series wrapped up. I published the last video just before noon local time on 12/31/23. LOL

Today I:

  • installed the smart bulb in my nightstand lamp and wrote the automations for the zigbee button to control it and added it to the dashboard.

  • did some minor dashboard cleanup

  • added 7 water leak sensors, including the notification/water shutoff notifications (would have been 8 but one was DOA, so I filled out the return paperwork to Amazon, and also ordered 1 more since I realized I didn’t order enough the first time. That will make a total of 17.)

  • added an environment sensor in my workshop and added that to the dashboard (that makes a total of 16)

I think that’s enough for now. In the last 3 days I’ve crossed off 2 things from my large list above, plus done some stuff I forgot to put on the list to begin with. LOL

2 Likes

I am new on my HA journey, and I’m slowing starting to integrate existing products I have. Today I decided to try to integrate the Switchbot curtains.

I plugged in a USB Bluetooth adapter I had laying around into my HA Green, and I opened HA on my laptop to start to research how to set everything up.
I go to Integrations in HA and it pops up saying New Integration found, so I clicked one button and my bluetooth was set up.
Then it pops up saying New Device found, I clicked one button and my Switchbot Curtain is now in my HA.

I thought this was going to be a project, and it took less than 5 minutes.

So much love for everyone putting in the the work to make this so straightforward for the newbies like me!

3 Likes

Awesome! Welcome to the journey.

They work even better if you get a skyconnect and hook them up via a switchbot hub 2 and matter!

2 Likes

I’m glad your first couple were easy, but trust me - the further you go, the more difficult it gets. LOL Not trying to be a buzzkill or to scare you off - it’s mostly the automations that get you. Problem is, the more devices you get, the more you want things to be inter-related, so your automations get more and more complex, which means they take longer to write, longer to debug, etc.

And just wait until you get tired of the stock dashboard… :smiley:

1 Like

Those last 2 leak sensors arrived today so I added them and configured the automations for them.

I also assembled some shelving for my receivers for my whole-home audio setup so I can clean up the cabling and get that episode filmed.

Ordered another chromecast to make my whole home audio setup simpler so it doesn’t rely on Google cast groups.

2 Likes