Help for a beginner getting solar generation from Fronius Inverter

This was just installed…?
I have just typed pip3 install --upgrade homeassistant and now it doesnt open at all, may errors

2019-02-24 22:02:25 ERROR (MainThread) [homeassistant.loader] Unable to find component use_legacy_protocol
2019-02-24 22:02:46 ERROR (MainThread) [homeassistant.setup] Error during setup of component http
Traceback (most recent call last):
File “C:\Users\Owner\AppData\Local\Programs\Python\Python36\lib\site-packages\homeassistant\setup.py”, line 151, in async_setup_component
hass, processed_config)
File "C:\Users\Owner\AppData\Local\Programs\Python\Python36\lib\site-packages\homeassistant\components\http_init
.py", line 152, in async_setup
ssl_profile=ssl_profile,
File “C:\Users\Owner\AppData\Local\Programs\Python\Python36\lib\site-packages\homeassistant\components\http_init_.py”, line 210, in init
setup_cors(app, cors_origins)
File “C:\Users\Owner\AppData\Local\Programs\Python\Python36\lib\site-packages\homeassistant\components\http\cors.py”, line 21, in setup_cors
import aiohttp_cors
ModuleNotFoundError: No module named ‘aiohttp_cors’
2019-02-24 22:02:46 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of system_log. Setup failed for dependencies: http
2019-02-24 22:02:46 ERROR (MainThread) [homeassistant.setup] Setup failed for system_log: Could not set up all dependencies.
2019-02-24 22:02:46 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of auth. Setup failed for dependencies: http
2019-02-24 22:02:46 ERROR (MainThread) [homeassistant.setup] Setup failed for auth: Could not set up all dependencies.
2019-02-24 22:02:46 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of onboarding. Setup failed for dependencies: http
2019-02-24 22:02:46 ERROR (MainThread) [homeassistant.setup] Setup failed for onboarding: Could not set up all dependencies.
2019-02-24 22:02:46 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of api. Setup failed for dependencies: http
2019-02-24 22:02:46 ERROR (MainThread) [homeassistant.setup] Setup failed for api: Could not set up all dependencies.
2019-02-24 22:02:46 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of websocket_api. Setup failed for dependencies: http
2019-02-24 22:02:46 ERROR (MainThread) [homeassistant.setup] Setup failed for websocket_api: Could not set up all dependencies.
2019-02-24 22:02:46 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of frontend. Setup failed for dependencies: api, websocket_api, http, system_log, auth, onboarding
2019-02-24 22:02:46 ERROR (MainThread) [homeassistant.setup] Setup failed for frontend: Could not set up all dependencies.
2019-02-24 22:02:53 WARNING (MainThread) [homeassistant.setup] Setup of recorder is taking over 10 seconds.

Not sure why pip3 isn’t working for you.

Try the below instead.

This is how i inztalled home assistant.

I am running windows

Deleted old config.yaml file when opening get these errors

2019-02-24 23:03:39 WARNING (Recorder) [homeassistant.components.recorder] Ended unfinished session (id=20 from 2019-02-24 11:53:52.653500)
2019-02-24 23:03:42 ERROR (MainThread) [homeassistant.core] Error doing job: Exception in callback _ProactorReadPipeTransport._loop_reading(<_OverlappedF…op_reading()]>)
Traceback (most recent call last):
File “C:\Users\Owner\AppData\Local\Programs\Python\Python36\lib\asyncio\events.py”, line 127, in _run
self._callback(*self._args)
File “C:\Users\Owner\AppData\Local\Programs\Python\Python36\lib\asyncio\proactor_events.py”, line 190, in _loop_reading
data = fut.result() # deliver data later in “finally” clause
File “C:\Users\Owner\AppData\Local\Programs\Python\Python36\lib\asyncio\futures.py”, line 238, in result
raise InvalidStateError(‘Result is not ready.’)
asyncio.base_futures.InvalidStateError: Result is not ready.
2019-02-24 23:03:58 ERROR (MainThread) [homeassistant.core] Error doing job: Exception in callback _ProactorReadPipeTransport._loop_reading(<_OverlappedF…ed result=b’’>)
Traceback (most recent call last):
File “C:\Users\Owner\AppData\Local\Programs\Python\Python36\lib\asyncio\events.py”, line 127, in _run
self._callback(*self._args)
File “C:\Users\Owner\AppData\Local\Programs\Python\Python36\lib\asyncio\proactor_events.py”, line 188, in _loop_reading
self._closing)
AssertionError

I would suggest watching the following video.

Or the full writeup.

I have not installed hass on a Windows machine, but from what I have watched of the video it seems pretty straight forward.
Hass.io has some advantages over the bare homeassistant, easier updates and installation of addons.

If you have just started using homeassistant then a fresh install would be my suggestion. Remove your pip3 install of homeassistant then start from scratch.

Some small changes to the yaml, should now work better.

sensor:
  # Fronius - Production
  - platform: rest
    resource: http://<your fronius IP>/solar_api/v1/GetInverterRealtimeData.cgi?Scope=Device&DeviceId=1&DataCollection=CommonInverterData
    method: GET
    name: "Current Power"
    value_template: >-
      {% if is_state('sun.sun', 'above_horizon') %}
        {{ (value_json.Body.Data.PAC.Value /1000 | int )|round(2) }}
      {% else %}
        0
      {% endif %}
    unit_of_measurement: kWh
    force_update: true
  - platform: rest
    resource: http://<your fronius IP>/solar_api/v1/GetInverterRealtimeData.cgi?Scope=Device&DeviceId=1&DataCollection=CommonInverterData
    method: GET
    name: "Total Power Today"
    value_template: >-
      {% if is_state('sun.sun', 'above_horizon') %}
        {{ (value_json.Body.Data.DAY_ENERGY.Value /1000 | int )|round(2) }}
      {% else %}
        0
      {% endif %}
    unit_of_measurement: kWh
    force_update: true
  - platform: rest
    resource: http://<your fronius IP>/solar_api/v1/GetInverterRealtimeData.cgi?Scope=Device&DeviceId=1&DataCollection=CommonInverterData
    method: GET
    name: "Total Power This Year"
    value_template: >-
      {% if is_state('sun.sun', 'above_horizon') %}
        {{ (value_json.Body.Data.YEAR_ENERGY.Value /1000000 | int )|round(2) }}
      {% else %}
        0
      {% endif %}
    unit_of_measurement: MWh
    force_update: true
  - platform: rest
    resource: http://<your fronius IP>/solar_api/v1/GetInverterRealtimeData.cgi?Scope=Device&DeviceId=1&DataCollection=CommonInverterData
    method: GET
    name: "Total Power Since Installed"
    value_template: >-
      {% if is_state('sun.sun', 'above_horizon') %}
        {{ (value_json.Body.Data.TOTAL_ENERGY.Value /1000000 | int )|round(2) }}
      {% else %}
        0
      {% endif %}
    unit_of_measurement: 'MW'
    force_update: true

Screenshot_2019-02-26%20Home%20Assistant

Above is using the entities card for lovelace

2 Likes

OK.
I have installed VM Box as per the video and we have Home Assistant running !
Now adding your code to the configuration.yaml file still doesnt help me…?
How do we make it display the data?
Clicking the 3 dots doesnt obviously help me…?

Are you using lovelace as your frontend?
If you are using lovelace then you should see 3 dots at the top right, click it and choose customize UI. Then down the bottom right you will see a large + button, click it. You should see a number of cards to choose from, choose entities, then you can pick the solar stuff in the entities dropdowns.

Yes, when I click on the plus which is at the top, i get the screen below…
No matter what drop down box i look through there is nothing referring to solar inverter?

Thats for the tabs, not the card. You should see a + sign down the bottom right for the cards. With a colored circle. Sorry can’t screenshot, at work.

On the video on that page you will see an orange buttom down the bottom right, that is what you click to add a card.

Hi,
When I click UI i get the screen below, there is no orange circle with a + ?
Its like the setup file is missing, do i need to create this manually?

See what you’re saying now. I am not sure why you don’t have the add cards option. Hopefully someone can jump in with a fix for you.
Just having a guess, and I could be way off the mark, bbut do you have anything in your:

frontend:

Setting in your configuration.yaml?

Definitely not right down the bottom right hand corner?
image

1 Like

No, definitely nothing, have scrolled down.
Do I need to enable lovelace in configuration.yaml?

No. If you have clicked the 3 dots in the top right and then selected ‘configure UI’, then you should have the plus button down the bottom… When you first went to Lovelace, did you click the option to take over control of the UI? I’m guessing you did since you have the option to edit…

Yes, I cant remember exactly what the wording was but answered yes to the pop up.

Try the below page, click the configure UI and see if you get the icon on the bottom right. If you don’t then it is a local issue, ie your browser.

The other option is to do everything via the lovelace yaml file.
Below is just one of many videos on howto.

Regards the solar stuff per original post, the sensors are working just fine.

Works perfectly on the demo page but not my page !
Could be because I am running as a virtual machine under windows?

Really want that feature as it looks very useful.

Interestingly I do get the orange circle with a + if I goto:
Configuration -

  • Area Registry
  • Automation
  • Script
  • Customization

These all work…?

It might be worth asking the question in the #lovelace Discord chat. It seems very strange that you can’t edit the GUI