The Envoy-S uses terminal blocks for power and metering connections. One solid-core current transformer (CT) is provided for revenue grade production metering. Two optional split-core CTs can be used to provide consumption metering.
The key word here being that consumption monitoring is optional.
The Envoy-S Metered (ENV-S-WM1-230) uses terminal blocks for metering connections. Install one CT for production metering and one CT for consumption metering as described in this section
As a reference, all of my ‘Energy Dashboard’ sensors use
sensor.envoy_SERIALNUMBER_current_power_consumption
AND
sensor.envoy_SERIALNUMBER_current_power_production
as a source, BUT then I use the Integration - Riemann sum integral sensor to convert Watts(Power) to WattHours(Energy) so that Energy Dashboard can graph it correctly.
If you skip this step, energy dashboard will not accept it.
I checked my grid sensors and found they both have state_class: total
For sensors with state_class STATE_CLASS_TOTAL_INCREASING, a decreasing value is interpreted as the start of a new meter cycle or the replacement of the meter. It is important that the integration ensures that the value cannot erroneously decrease in the case of calculating a value from a sensor with measurement noise present. This state class is useful for gas meters, electricity meters, water meters etc.
What are you trying to achieve with sensor.envoy_SERIALNUMBER_today_s_energy_consumption and why is the last_reset missing causing you a problem?
If you are referring to energy dashboard, then you might be trying to use the wrong sensor.
Please re-read post #1 of this thread for directions.
Thank you so much for the detailed response! i am simply trying to setup my energy dashboard. i will make the new sensors and use them instead. Am i correct in thinking i still need to have the intergration installed?
Yep, keep the enphase integration configured as we use those enphase sensors as a base to build on.
The sensors we create in post#1 use the enphase sensors as a source and we get home assistant to perform some calculations to extract the grid import and grid export figures that aren’t normally available
Just follow the first 5 posts in this thread from the beginning and you will get exactly what you wanted add be able to get the HA energy dashboard working!
Note:
I only just added the net_power sensor, hence why the grey isn’t there for the whole day yet.
Here are the sensors the card uses
template:
- sensor:
name: Solar Power Corrected
state_class: measurement
icon: mdi:solar-panel
unit_of_measurement: W
device_class: power
state: >
{% set value = states('sensor.envoy_SERIALNUMBER_current_power_production') | int %}
{% if value <= 5 -%}
0
{% elif is_state('sun.sun','below_horizon') %}
0
{%- else -%}
{{ value }}
{%- endif %}
- sensor:
- name: Net Power
state_class: measurement
unit_of_measurement: W
device_class: power
icon: mdi:transmission-tower
state: >
{% set production = states('sensor.solar_power_corrected') | int %}
{% set consumption = states('sensor.envoy_SERIALNUMBER_current_power_consumption') | int %}
{{ (production - consumption) }}
I’m trying to get my meter totals to be to 2 final places, it’s working for numbers with more than 2 decimals switch as 1.2345678 however for numbers that are totalled as 1.2 it does not make up to 2 decimals places like 1.20.
I tried applying the ceiling method but obviously not got it right:
Yes I have been using the developer tools and did exactly like you suggested. Rounding is ok for any number with more than 1 decimals place, then the number is rounded to 2 places. But when a single decimal place number it does not add the “0” to make it appear as a monetary number… 1.7 regains as that rather than the desired 1.70
It seems the format() only applies to strings and does not apply to numbers.
Depends on what you want to do with the number?
If you want it to be able to be graphed, or to have this number manipulated by other sensors and used in other calculations, then a string will not work.
If you want it to just look pretty on a dashboard, then a string will work.
In order to make it a string, you pretty much just need to insert a text character to no longer make it a number. In my case I put a $ before the {{ }} section.
This is how I did it just using a static value for testing
Notice how it no longer graphs?
Now it just shows in the history when the string value changes to a different string value in a flat time line.
This is because it is no longer a number, and is now a string and strings cannot be graphed.
Bonus: Here is another example of a string that I currently record the history of when it changes that shows the days are getting shorter.
LOL thanx for your further investigation, now I must ask the basic question of HA. If the sensor is set up as a “Monetary” value then surely it should be formatted to the expected 0.00 no matter what. There seems to many times that units are an issue in HA and I would love to see that aspect improved in the future. I would love to see units selectable from the Dashboard Card so that you can select a divider to make Watts in to kW or vise versa. As an end user I don’t see why it cant be that easy…but I suppose there must be a technical reason why it is not that easy.
Yeah thats one for the Home Assistant LoveLace Devs.
After reading those links about floating point, I can sort of appreciate why they might struggle doing so.
Perhaps they should give us something else to store currency figures as other than integer or floating point numbers? Perhaps there already is another way and I’ve missed something.
This link says that monetary device class is just a way of assigning a relevant symbol.
I
I think the issue with this is granularity of data.
Say If I have a sensor that only records in kW and I pull a slider to W (which divides it by 1000), some users might expect the graph to look 1000 times more detailed however there isn’t enough granular data to fill in the gaps in the graph between 6 kW to 7kW for example. It will just show as a large jagged step on the graph.
@del13r Out of interest, have you tried @vk2him ’s new mqtt add on? I’ve been chatting to him on the repo because I’ve been having some trouble getting it to work reliably. For me, sometimes it kicks in immediately, sometimes it doesn’t, sometimes it kicks in after several minutes etc. Just looking for another data point…