ZsBT / hass-w1000-portal

Home Assistant custom component for W1000 energy portal (e.g. https://energia.eon-hungaria.hu/ )
Do What The F*ck You Want To Public License
45 stars 4 forks source link

HA sensors getting "Unknown" value #3

Closed lajosdani closed 1 year ago

lajosdani commented 1 year ago

Hi, I attached the screenshots from the W1000 EON environment and from my HA dashboard and logbook. Unfortunately the logbook does not include any entries for the two sensors. If I can give you any more info, or do any more research, just tell me.

eon w1000 dashboard

HA w1000 term sensor logbook

HA energy sensors

ZsBT commented 1 year ago

Thanks Dani,

The reports in your dashboard look nice as they show some values. Let's check whether at least they arrive to Home Assistant. First, can you please check your configuration yaml, whether it searches the correct reports. It should look like this:

w1000-energy-monitor:
  (...)
  reports: Fogy,Term

Report names are case-sensitive. Shall you need to fix it, remember to restart Home Assistant.

Next, check the values in Home Assistant: go to Developer Tools -> States and enter w1000 to Filter entities. It will display the last known value. image

If the entity is Unknown:

It means the integration is not able to read the W1000 portal. This case, please share the relevant Home Assistant logs. To achieve this, increase the log level for the integration. In configuration.yaml:

logger:
  logs:
    custom_components.w1000-energy-monitor: debug

After restart, search the logs for the integration, e.g. using the command # grep w1000 home-assistant.log

If the entity has a value:

We are good to go; just one step to the Energy Board.

As the kind of measurement can not be detected automatically, you need to create a helper (e.g. a template sensor) to make the Energy Dashboard understand it. For example, the total consumption is an increasing value, so this can be added to the dashboard:

- template:
    - sensor:
        - name: fogyasztás
          unit_of_measurement: "kWh"
          state_class: total_increasing
          device_class: energy
          state: >
            {{ states("sensor.w1000_fogy") | float }}
        - name: termelés
          unit_of_measurement: "kWh"
          state_class: total_increasing
          device_class: energy
          state: >
            {{ states("sensor.w1000_term") | float }}
lajosdani commented 1 year ago

Thanks Zsombor, I think I could make a step further with your help. It is still not working, but as I followed your instructions, I got the log with errors:

log

And this line belongs here as well: "TypeError: 'NoneType' object is not subscriptable" This is the end of the relevant logs.

Here is the states screenshot: states

And the config.yaml file: config yaml

So it seems, that the values are not coming from the W1000 page to my HA. What can I do, to solve this? :) Thank you in advance!

ZsBT commented 1 year ago

Hi Dani, Thanks for the log. Based on the log entry report Term not found, I guess the integration does not handle spaces in the list of report names. Can you please try reports: Fogy,Term instead of reports: Fogy, Term (removing the space after the comma)? I'll make a bugfix for this.

lajosdani commented 1 year ago

Hi Zsombor, You were right, the space caused some problems.

Now I get the following report: 2022-11-22 15:10:23.194 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration sonoff which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant 2022-11-22 15:10:23.195 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant 2022-11-22 15:10:23.195 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration panasonic_cc which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant 2022-11-22 15:10:23.196 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration w1000-energy-monitor which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant 2022-11-22 15:10:23.196 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration skodaconnect which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant 2022-11-22 15:10:23.196 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration openmediavault which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant 2022-11-22 15:10:29.137 WARNING (MainThread) [homeassistant.components.broadlink.switch] The switch platform is deprecated, except for custom IR/RF switches. Please refer to the Broadlink documentation to catch up 2022-11-22 15:10:29.723 DEBUG (MainThread) [custom_components.w1000-energy-monitor] reading report Fogy 2022-11-22 15:10:29.740 DEBUG (MainThread) [custom_components.w1000-energy-monitor] registered sensor: sensor.w1000_fogy 2022-11-22 15:10:29.741 DEBUG (MainThread) [custom_components.w1000-energy-monitor] registered sensor: sensor.w1000_term_2 2022-11-22 15:10:29.750 DEBUG (MainThread) [custom_components.w1000-energy-monitor.sensor] None 2022-11-22 15:10:29.750 DEBUG (MainThread) [custom_components.w1000-energy-monitor.sensor] None 2022-11-22 15:10:30.338 DEBUG (MainThread) [custom_components.w1000-energy-monitor] resp status http 200 2022-11-22 15:10:30.618 DEBUG (MainThread) [custom_components.w1000-energy-monitor] reading report Term 2022-11-22 15:10:30.718 DEBUG (MainThread) [custom_components.w1000-energy-monitor] Notifying all listeners 2022-11-22 15:10:30.720 DEBUG (MainThread) [custom_components.w1000-energy-monitor.sensor] {'state': 10652.2, 'unit': 'kWh', 'attributes': {'curve': 'HUXXXXXXXXXXXXXXXXXXXXXX DP_1-1:1.8.00', 'generated': '2022-11-22T00:00:00', 'state_class': 'measurement', 'device_class': 'energy'}} 2022-11-22 15:10:30.720 DEBUG (MainThread) [custom_components.w1000-energy-monitor.sensor] {'state': 18456.8, 'unit': 'kWh', 'attributes': {'curve': 'HUXXXXXXXXXXXXXXXXXXXXXX DP_1-1:2.8.00', 'generated': '2022-11-22T00:00:00', 'state_class': 'measurement', 'device_class': 'energy'}}

It seems, that I have to recreate the sensors, because somehow the sensor "w1000_term" got renamed to "w1000_term_2" Will try to recreate them, and come back to you.

Until then, some good news as well. The other sensor is working great :) image

ZsBT commented 1 year ago

Great, now both sensors from the integration arrive as entities. Yes, you need to align your termelés template sensor, according to the new entity name "w1000_term_2". From this point, you're good to go. I'll close this issue when the space fix for report name list is ready.

lajosdani commented 1 year ago

It is working now! :) I created the template sensors as well, to add them to the energy dashboard, but some strange message comes up, when I try to add them:

image

Is it a problem? Because the energy dashboard seems to be working:

image

Thank you for all your help, and your work with this integration, it is a very good addition to the community :)

ZsBT commented 1 year ago

Hi Dani,

Yes it is a problem; I can not provide proper measurement entities from the integration. It seems your Energy Board still uses them directly (as sensor.w1000_fogy and sensor.w1000_term_2 seem). Delete both from Energy Board (make sure it is empty), then ensure these are present in configuration something like this:

- template:
    - sensor:
        - name: fogyasztás
          unit_of_measurement: "kWh"
          state_class: total_increasing
          device_class: energy
          state: >
            {{ states("sensor.w1000_fogy") | float }}
    - sensor:
        - name: termelés
          unit_of_measurement: "kWh"
          state_class: total_increasing
          device_class: energy
          state: >
            {{ states("sensor.w1000_term_2") | float }}

After HA restart, add "sensor.fogyasztas" and "sensor.termeles" to Energy Board, not the w1000 ones. From the next morning, values should appear once a day (when a new value comes from EON).

Zsombor

lajosdani @.***> ezt írta (időpont: 2022. nov. 22., Ke 23:44):

It is working now! :) I created the template sensors as well, to add them to the energy dashboard, but some strange message comes up, when I try to add them:

[image: image] https://user-images.githubusercontent.com/96892957/203435706-99b82963-a0c0-4433-8153-0fa66d89b431.png

Is it a problem? Because the energy dashboard seems to be working:

[image: image] https://user-images.githubusercontent.com/96892957/203436372-31b88b3f-4a06-45b3-b3d5-a44337320314.png

Thank you for all your help, and your work with this integration, it is a very good addition to the community :)

— Reply to this email directly, view it on GitHub https://github.com/ZsBT/hass-w1000-portal/issues/3#issuecomment-1324334372, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABF3SO47WPQFCM6YYPPZNWDWJVEGXANCNFSM6AAAAAASFZWJIM . You are receiving this because you modified the open/close state. Message ID: @.***>

lajosdani commented 1 year ago

Hi Zsombor, Sorry, it was my bad, you are right. I chose the w1000 sensors, and not the template sensors from the config file. Now that I replaced them, they work as a charm :)

image

Thank you again for your help!

ZsBT commented 1 year ago

Great to see the results! Thanks Dani for the feedback. Zsombor

lajosdani @.***> ezt írta (időpont: 2022. nov. 23., Sze 16:36):

Hi Zsombor, Sorry, it was my bad, you are right. I chose the w1000 sensors, and not the template sensors from the config file. Now that I replaced them, they work as a charm :)

[image: image] https://user-images.githubusercontent.com/96892957/203586788-fb3a6c4f-ce1d-461e-b9a8-844b3116d50d.png

Thank you again for your help!

— Reply to this email directly, view it on GitHub https://github.com/ZsBT/hass-w1000-portal/issues/3#issuecomment-1325265449, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABF3SO4JX4QFCWK742Z2TWTWJY2WNANCNFSM6AAAAAASFZWJIM . You are receiving this because you modified the open/close state.Message ID: @.***>