Closed Louisbertelsmann closed 1 year ago
I wanted to set up the Energy Dashboard and I couldn't add some entities, because they lacked last_reset.
I am curious, what did you want to add to the energy dashboard?
I wanted to add those daily Sensors to the premade energy dashboard. That wasn't possible, because it needs last_reset and that isn't Provided by stateclass measurement. It needs to be total_increasing. Will fix it tomorrow. If you need any more help, you can just ask.
My Energy Dashboard configuration dialogue looks like this. I only see the option for total import/export energy. Where can you set daily sensors?
I just added them in the corresponding categories. For that, you need last_reset. That isn‘t provided by measurement, only by total(_increasing).
I‘m not at home right now, so I‘m on my work iPad.
Am fixing your requested changes right now.
I am also using the total_... sensors for my energy dashboard. Until now everything works. I see my daily values. HA should do the work at midnight and calculate the relevant values.
Didn‘t know it does that. That‘s great!
aaah, you used the daily sensors for the energy dashboard. Was really confused, because it was working fine for me so far.
I guess, the README needs some clarification.
Will merge your changes - thank you!
Just read through some old pull requests. I think I‘ve got a new way to set the slave ID outside of secrets.yaml. Wouldn‘t it be possible to add an input_numer that goes from 1 to 247(i think) and sets the slave variable for every sensor at once? That would mean that you can remove configuration from secrets.yaml, because the ip_address and the port only needs to be set once and that‘s easily accessible. That would also be possible to do by an input_number or input_text if you want to.
linked your suggestion to
https://github.com/mkaiser/Sungrow-SHx-Inverter-Modbus-Home-Assistant/issues/38
otherwise it will get lost :)
I don‘t know if it works for you, but I just noticed that the new sensors I added don‘t report anything. Would you mind checking it? They all just show as 0,0kWh… I checked your „daily battery charge from pv“ read-out and the address you gave it is 13011. In the newest modbus list from sungrow it‘s 6744-6774. 13011 is export power.
Be carefull with modbus address and register. Daily battery charge energy from PV is register(address) 13012 in Sungrow documentation. In modbus.yaml you have to use 13011 (13012 - 1).
And address 6744-6774 seems to be 31 registers which are holding 1 value per day of month. Maybe you could try if you could get data from this registers.
If I am right with my calculation for yesterday (25. day) you have to read reg 6768 (in modbus.yaml 6767).
You could also find 12 monthly and 20 yearly registers in the documentation.
I thought something like that would be the case, but I wanted to know for Sure. Unfortunately sungrow doesn't offer a real monthly read-out. Someone on the photovoltaikforum wrote something about undocumented addresses. Does Someone have a list like that? I also found another address list on the io Broker forum, but I didn't have the time to Look through it. Will Do it this evening.
Have you got any clue on how those yearly generation registers are laid out? I just read them with QModMaster and two inputs have got anything in them. (That makes sense since I only installed it in early september. address 6264 converted to decimal is 11122 (1112.2kWh) and address 6266 (this year) converted to decimal is 1189 (118.9kWh) which makes sense, because that adds up to the total pv generation. The rest of the registers is either 0000000000000000 or 1111111111111111.
I think that there is one empty register between all of the filled ones. If that's the case there are 8 registers before 2023, so when my math is correct it should've started in the year 2015.
When that's correct, I would read out all registers and create an automation that writes the current year into it's own template sensor, if possible.
Nevermind. The automation that changes the year would need extra setup. I like the idea of just copy-pasting something and not needing a lot of setup. If you've got an idea, I would love to hear that.
Ok, I think I just found a way. With {{ now().year }} I can read the current year and based on that I can change which sensor the template uses.
I was stupid. It's a 32-bit integer and one register only shows 16-bits.
Found a way to implement it. Found the "command" {{ now().year }}. This is the template I came up with: {{ states('sensor.total_pv_generationof{{ now().year }}') }} The name of the sensors is total_pv_generation_of_2023 (for example) and that should work fine. We'll see in 340 days.
works now.
{% if (states('sensor.current_year') | int(default=0)) == 2019 %} {{ states('sensor.total_pv_generation_of_2019') }} {% elif (states('sensor.current_year') | int(default=0)) == 2020 %} {{ states('sensor.total_pv_generation_of_2020') }} {% elif (states('sensor.current_year') | int(default=0)) == 2021 %} {{ states('sensor.total_pv_generation_of_2021') }} {% elif (states('sensor.current_year') | int(default=0)) == 2022 %} {{ states('sensor.total_pv_generation_of_2022') }} {% elif (states('sensor.current_year') | int(default=0)) == 2023 %} {{ states('sensor.total_pv_generation_of_2023') }} {% elif (states('sensor.current_year') | int(default=0)) == 2024 %} {{ states('sensor.total_pv_generation_of_2024') }} {% elif (states('sensor.current_year') | int(default=0)) == 2025 %} {{ states('sensor.total_pv_generation_of_2025') }} {% elif (states('sensor.current_year') | int(default=0)) == 2026 %} {{ states('sensor.total_pv_generation_of_2026') }} {% elif (states('sensor.current_year') | int(default=0)) == 2027 %} {{ states('sensor.total_pv_generation_of_2027') }} {% elif (states('sensor.current_year') | int(default=0)) == 2028 %} {{ states('sensor.total_pv_generation_of_2028') }} {% elif (states('sensor.current_year') | int(default=0)) == 2029 %} {{ states('sensor.total_pv_generation_of_2029') }} {%endif%}
I wanted to set up the Energy Dashboard and I couldn't add some entities, because they lacked last_reset. I fixed all of the entities that didn't work and added the sensors: Monthly direct energy consumption Yearly direct energy consumption Monthly PV energy yields Yearly PV energy yields Monthly exported energy from PV Yearly exported energy from PV
I added unique ids to the sensors I added.