Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mapping of sensors #60

Closed
Tokn59 opened this issue Sep 28, 2020 · 12 comments
Closed

Mapping of sensors #60

Tokn59 opened this issue Sep 28, 2020 · 12 comments

Comments

@Tokn59
Copy link

Tokn59 commented Sep 28, 2020

Hi, thanks for sharing this great integration !

I have some difficulties mapping the right sensors.

I have the following sensors through DSMR (working om modbus integration)

sensor.energydel -> This is the TOTAL Kwh consumed
sensor.energyret -> This is the TOTAL Kwh produced
sensor.powerdel -> The current power delivery
sensor.powerret -> The current power produced
sensor.powerretl1 -> Same as powerret ???

If more energy is produced than consumed powerdel = 0
If more energy is consumed than produced powerret = 0

My DSMR values are :

dsmr

For now I did the following :

power card

How would you map this in the card ?

Also I have delivery and return seperate for day/night so actually 4 values.

Many thanks & KInd regards,

Tony

@Tokn59
Copy link
Author

Tokn59 commented Sep 30, 2020

New update .. Got it to work just fine but I get the error "Units not equal for all sensors for the power view". All values are in Kwh ... This is the card configuration. Any ideas ?

power wheel issue

@gurbyz
Copy link
Owner

gurbyz commented Sep 30, 2020

The card looks for this unit information in the sensors itself. You can check in Home Assistant > Developer Tools > States if the unit_of_measurement is present and correct in all your sensors. Please note that Kwh (as you write in your second comment) isn't the same as kWh. The casing (upper or lower) should also resemble.

If some of your sensors lack the unit information, you could add it yourself in Home Assistent. If you didn't make the sensors yourself, you can still add the unit like here.

@gurbyz
Copy link
Owner

gurbyz commented Sep 30, 2020

Looking at your config in your second comment: you shouldn't use the same sensor for solar_power_entity as for grid_power_production_entity. That can't be correct.

solar_power_entity should be used with a sensor that measures your solar panels (=your power inverter).

If you have troubles understanding the readme file, please use the readme file on dev branch. That one is already rewritten and more to the point.

@p10tyr
Copy link

p10tyr commented Oct 2, 2020

Hello - (sorry to hijack this but it seems related) I seem to be misunderstanding something too.

You can see that

  • PV 614W
  • load 609W (how much my house is using)
  • grid usage 0 (so no import and no export)

On the power wheel it is showing

  • bottom left power line icon (grid?? should be 0 but its 609)
    • why is this not under my home icon?
  • The value under the home icon (bottom right) is 1223W ??

image
image

@p10tyr
Copy link

p10tyr commented Oct 2, 2020

Obviously after I wrote the above I played around a bit and realised what the problem was.
I was plugging in too much data- I really love your plugin thanks a lot.. but the documentation is still a bit confusing.

I removed

  • grid_power_consumption_entity: sensor.inverter_load
  • grid_power_production_entity: sensor.inverter_grid

image

image

I know you wrote it down in bold but it still did not hit my brain clearly that only these two are required.. (what are the other two for any way I don't understand?)

image

maybe instead of writing "either A or B+C" be more explicit. "When using B+C do not use A" ?

@Tokn59
Copy link
Author

Tokn59 commented Oct 2, 2020

My extra problem is the data comes from 2 different devices. Solar production comes directly from the Sunnyboy via modbus integration whilst my power consumption (momentaneous) comes from a DIY device connected to smart metering.

In developer tools I see :

Device 1:
sensor.powerret unit of measurement : W (current value 0.548) (unit of measurement does not seem right as it is indeed 548 W and so 0.548 kW)

Device 2:
sensor.smapwrl1 unit of measurement : kW (current value 0.84)

Secondary problem : Night and Day consumption and production are different meters (On Device 1)

Any hints are more than welcome !

@p10tyr
Copy link

p10tyr commented Oct 2, 2020

@Tokn59 I am new to HomeAssistant but maybe its worth trying to see if you can create two new sensors, that take values from your other sensors based on your criteria.. I'm not sure.. is that going to be a Script maybe? An automation?

I can try and look for you because this means I can learn something new too and may need that same thing in the future..

But back to my problem, I thought my problem was solved with using PV input and Grid.. but the values are still very strange.
Why does it look like my house is exporting electricity with PV?
Is it not supposed to be the PV arrow green to my house, and the GRID ---> shows import?

I looks like I am exporting 3kw to the grid for some reason?

image

@gurbyz
Copy link
Owner

gurbyz commented Oct 4, 2020

maybe instead of writing "either A or B+C" be more explicit. "When using B+C do not use A"

That's a good one. I'll add something to the docs.

What these B+C sensors are for: some people have B+C sensors (instead of the usual A sensor). When your A sensor would turn negative, their B becomes 0 and their C gets the absolute value of your A sensor. But please forget, it's very rare.

@gurbyz
Copy link
Owner

gurbyz commented Oct 4, 2020

Device 1:
sensor.powerret unit of measurement : W (current value 0.548) (unit of measurement does not seem right as it is indeed 548 W and so 0.548 kW)

You can use a template sensor. I.e. you have to create one. This should help you start with it:

sensor:
  - platform: template
    sensors:
      my_better_sensor:
        friendly_name: 'My better sensor'
        unit_of_measurement: 'W'
        value_template: >-
          {{ (1000 * (states("sensor.my_original_sensor") | float) | int }}

You can do similar things to get a total sensor for you day and night sensors.

value_template: >-
          {{ (states("sensor.my_original_day_sensor") | float) + (states("sensor.my_original_night_sensor") | float) }}

@gurbyz
Copy link
Owner

gurbyz commented Oct 4, 2020

I looks like I am exporting 3kw to the grid for some reason?

You have grid_power_entity: sensor.inverter_grid, so the value of this sensor is shown at the grid icon. Since production_is_positive: true the card will interpret the positive value 3035 as 'producing/exporting to the grid' and the grid icon will turn green according that.

I don't know for sure what your 'Inverter load' and 'Inverter grid' sensor measure, but if you expected a grid import (a.k.a. grid consumption) of 2880, you can try production_is_positive: false.

gurbyz added a commit that referenced this issue Oct 4, 2020
@Tokn59
Copy link
Author

Tokn59 commented Oct 5, 2020

Done and working ! Thank You !!!

@gurbyz gurbyz mentioned this issue Oct 5, 2020
@p10tyr
Copy link

p10tyr commented Oct 6, 2020

@gurbyz - I had a typo in the config

production_is_postive: false -- missing i in the positive bit

It works now 😄

To answer your question

  • LOAD - This is how much power my house is using in total. Like a central watt monitor for my whole house. 🥰
  • GRID - Measured at the meter for buying or selling
    • Positive means buying that much power (import)
    • 0 so no buying or selling of power, purely powered by solar
    • Negative means selling that much power (export)

And that is what I use in the config which looks like this now

type: 'custom:power-wheel-card'
title: Inverter
solar_power_entity: sensor.inverter_pv_power
grid_power_entity: sensor.inverter_grid
production_is_positive: false

Thank you very much for this. I will also explore the money options.. that looks really cool

@gurbyz gurbyz closed this as completed Oct 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants