jeremyhamm / homeassistant-sdge-time-of-use

MIT License
6 stars 0 forks source link

Any thought to making this an entity with home assistant? #1

Open dethpickle opened 2 years ago

dethpickle commented 2 years ago

My understanding of what you've done is that you're using javascript to make a lovelace card show which tier is active. But, I don't see how it'd be available to anything within HA to utilize that information.

Do you have a way for HA to use this like an entity value? If so, could you point me in the right direction?

Thanks!

jeremyhamm commented 2 years ago

I do not know of a SDG&E integration for HA. Unfortunately the process of getting data from SDG&E is extremely difficult, maybe impossible for a solo developer.

I use this specific card to know which tier it currently is.

dethpickle commented 2 years ago

Thanks, Jeremy. I actually think what you've done is plenty good for me as far as just knowing what tier is active. I was more asking if you knew of any easy way to get that information exposed into an HA entity, rather than a browser-side javascript rendering. I mean, basically just making an automation that takes into account all of the times of day/week/year. I wasn't expecting an SDGE add-in. For me, using the Rainforest Eagle and Emporia Vue gets me my power info. I was just trying to add in the pricing tiers and saw your effort as the closest to starting that. Only, again, to me it seems only render-time and not something available to HA to work with. But... I'm also not good with javascript. Is there a way to encapsulate that into an entity? Or should I just start it from scratch? It's probably just an automation's worth to be able to take the datetime and use hardcoded tier/pricing that I'd need to manually update each year. Just looking to see if you had done any of that since this was a couple years old. Cheers!

TFWol commented 1 year ago

@dethpickle Did you ever find a solution?

BHSPitMonkey commented 9 months ago

You can fairly easily create a template sensor entity that gives the current tier based on the time of day / day of week. There's a forum answer here showing how: https://community.home-assistant.io/t/help-with-sdg-e-san-diego-electricity-cost-calculations/615078/6

You can then use that in other automations / lovelace cards, or create a second template sensor that gives the current price per kW based on the state of the first sensor.

dethpickle commented 9 months ago

@dethpickle Did you ever find a solution?

Sorry, I missed this. No, I didn't. What @BHSPitMonkey references here works fine. What bugs me, is I think SDGE should be sending that info down the HAN and I should be able to see it in my Rainforest Eagle, but no. And now, they've sunsetted the whole HAN thing, so if/when my Eagle dies, I'll be SOL on that. I have to start using the Emporia Vue for everything - which means, I'll need to flash it, which I haven't been successful with yet. (I can't solder worth a damn)