Skip to content
This repository has been archived by the owner on Feb 2, 2022. It is now read-only.

Support multiple rooftops ? #13

Open
B-Hartley opened this issue Mar 16, 2021 · 10 comments
Open

Support multiple rooftops ? #13

B-Hartley opened this issue Mar 16, 2021 · 10 comments

Comments

@B-Hartley
Copy link

As SolCast are stopping tuning, they are offering up to two rooftops per accounts to allow for split arrays.
How difficult would it be for your component to take two RoofTop IDs, get forecasts for both and add them together?

Or to allow you component to be setup twice with different info, I could then add it together myself.

Thanks,
Bruce.

@dannerph
Copy link
Owner

Hi Bruce,
from software architecture view I would go with the second solution, as some of the users might have two completelly different PV system to be observed.
I guess the API limit is valid for both RoofTops, that might need some refactoring of the code ...

I am currently busy with a wast colleaction schedule integration, thus do not have time for the solcast integration right now.

@B-Hartley
Copy link
Author

No problem. So can two sessions of your integration be added in it’s current form.
could I make copies of it and change one to solcast2 or something.

@B-Hartley
Copy link
Author

As a temporary fix, I've made a copy of thecustom component under the domain "solcastx" and that way I can run two separate instances and add them together.
If anyone else wants to do that and needs a hand, let me know.

@nonlinearsugar
Copy link

These instructions were helpful in creating a duplicate component: https://community.home-assistant.io/t/how-can-i-create-a-custom-component-by-copying-another/120455

@B-Hartley
Copy link
Author

Yes, that's pretty much what I did. Thanks

@monkeydust
Copy link

thanks for this - worked for me

@nonlinearsugar
Copy link

nonlinearsugar commented Apr 26, 2021

This was the template sensor I created to combine the two separate estimates, and the gauge. Does anyone know how to include the "Tomorrow" and "The day after tomorrow" attributes?

#Add to configuration.yaml
sensor:
  - platform: template
    sensors:
      solcast_forecast_total:
        friendly_name: "Solcast Forecast - Total"
        value_template: "{{ states('sensor.solcast_forecast') | float + states('sensor.solcast_forecast_2') | float }}"
        unit_of_measurement: "kWh"
        unique_id: "FpE8m3GmgBsQ"


#Add to Dashboard
type: sensor
entity: sensor.solcast_forecast_total
graph: line

@B-Hartley
Copy link
Author

It would be........

sensor:
  - platform: template
    sensors:
      solcast_forecast_tomorrow_total:
        friendly_name: "Solcast Forecast Tomorrow - Total"
        value_template: "{{ state_attr('sensor.solcast_forecast','Tomorrow') | float + state_attr('sensor.solcast_forecast_2','Tomorrow') | float }}"
        unit_of_measurement: "kWh"
        unique_id: "xxxxxxxxxxxxx"

@Aereau
Copy link

Aereau commented May 27, 2021

As a temporary fix, I've made a copy of thecustom component under the domain "solcastx" and that way I can run two separate instances and add them together.
If anyone else wants to do that and needs a hand, let me know.

I want to say: great stuff that you already did this. I have an east-west solar configuration on my roof and use two sites for it in Solcast. I would like to add them together and also limit them to the max output of my inverter (I know the Python math for that :))

I have copied the "solcast" custom component folder and renamed it "solcastx", I have also changed the latter manifest.json.
I have the following in my configuration.yaml:

solcast:
api_key: XXXXX
resource_id: EAST
api_limit: 20
disable_ssl_check: False
disable_automatic_forecast_fetching: False
disable_automatic_history_fetching: False

solcastx:
api_key: XXXXX
resource_id: WEST
api_limit: 20
disable_ssl_check: False
disable_automatic_forecast_fetching: False
disable_automatic_history_fetching: False

However, upon adding an entity in the dashboard, it only sees "sensor.solcast_forecast" entity but not the "x" variants.

What am I doing wrong?

EDIT:
In addition to editing manifest.json, I also edited the "domain" in init.py to "solcastx", now it seems that I do have "sensor.solcast_forecast_2"!

@B-Hartley
Copy link
Author

There's a bit more to it than that.
You have to actually change the code inside the custom component.
Take a look at my solcastx custom component.

https://github.com/B-Hartley/bruces_homeassistant_config/tree/main/custom_components/solcastx

Strangely, I'm not acutally using it, as my tuned rooftop is still working and still tuning. So I haven't had the need to switch to the split rooftop setup.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants