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

Turning the inverter on and off #61

Open
pitrade opened this issue Nov 7, 2024 · 12 comments
Open

Turning the inverter on and off #61

pitrade opened this issue Nov 7, 2024 · 12 comments
Assignees
Labels
enhancement New feature or request

Comments

@pitrade
Copy link

pitrade commented Nov 7, 2024

When turned on, even with the limit set to 0%, the inverter still draws about 8 W from my Battery. Therefore I recommend the feature to turn the device on and off with the web UI and also via MQTT with e.g. HomeAssistant.

@ohAnd ohAnd added the enhancement New feature or request label Nov 17, 2024
@ohAnd ohAnd self-assigned this Nov 17, 2024
@ohAnd
Copy link
Owner

ohAnd commented Nov 26, 2024

Hi @pitrade ,

it is now implemented - please check the new snapshot for your needs.
Not all input methods are already checked, so please tell what kind of setup is running on your site/what situation you were able to check to get a "hook" on the test list ;-)

BR

@pitrade
Copy link
Author

pitrade commented Nov 27, 2024

My Setup is dtuGateway on ESP32 and HomeAssitant with MQTT. I tested with the latest snapshot but didn't get control elements to turn the inverter on/off. Neither in HomeAssitant nor in the web interface.
Screenshot from 2024-11-27 11-50-49
Screenshot from 2024-11-27 11-55-40

@ohAnd
Copy link
Owner

ohAnd commented Nov 27, 2024

Hi @pitrade ,
as originally "requested" (#59) ;-) - inverter is turned to OFF with PowerLimit = 0 and turned ON again if powerlimit > 0 (powerlimit = 1 will be interpreted as 2 due to the limitation of DTU)
See readme also https://github.com/ohAnd/dtuGateway/tree/develop?tab=readme-ov-file#regarding-dtu

One small additonal change I made in the recent update today for HA - the entry point allows now also input values below 2 (= 1, 0).

Please check again.

@pitrade
Copy link
Author

pitrade commented Nov 28, 2024

Ah, nice. I thought you would implement a simple on/off button like openDTU. For me this solution is even better bc I no longer have to worry about the difference between PowerLimit=0 and turned OFF but there might be the demand for a separate ON/OFF button by others. With snapshot 65 I am still not able to set the powerlimit below 2% as you mentioned. I will update to 66 in my lunch break and report my results.
Screenshot from 2024-11-28 10-16-32

@pitrade
Copy link
Author

pitrade commented Nov 28, 2024

Turning the inverter OFF/ON by setting the powerlimit either to 0% or any value above works perfectly. Thank you a lot! Feel free to contact me for further beta testing in a ESP32+HomeAssistant environment.

ohAnd added a commit that referenced this issue Nov 30, 2024
…ter turn to on + upgrade openhab item reading to json interpretation
@ohAnd
Copy link
Owner

ohAnd commented Dec 10, 2024

Hi @pitrade ,

I've implemented some extensions regarding this topic ... due to some playing/ testings around with some corner cases... for inverter on/off and back.
I didn't found something easy to get the current state for inverter on/off on dtu side. So I'm using now a cyclic polling of the current warnings of the dtu - because there is a specific entry in the list, when the "Inverter is remote off".

  1. I also added a filter for changes of inverter on/off that prevents turn to off and on again within 60 seconds (and also vis-vis). (60 seconds for the testing phase - have to find best needed value)
  2. the local inverter state off (in dtuGateway) will be checked with the warning (described above).
  3. with the need to get the warnings - there was a new feature born for the webpage:
    image
    see also readme extension... - not all error codes are already seen on my side, if you get unknown warnings please note the shown error code - and if possible check with the s-miles app and direct connection to the dtu the current readable warnings - so that I can extend the lookup table in code

So, now to your offer ;-)

Please check with different use cases the points above. Especially the stability of turning inverter on/off and the state recognition...

Thx

@pitrade
Copy link
Author

pitrade commented Dec 11, 2024

Hi @ohAnd

I updated to the latest snaphot and keep it running. My Home Assistant automatically sets the inverter limit depending on household consumption, battery SoC and grid electricity price.

@pitrade
Copy link
Author

pitrade commented Dec 11, 2024

Screenshot from 2024-12-11 10-05-45

@pitrade
Copy link
Author

pitrade commented Dec 12, 2024

This night the inverter turned on for no reason. The inverter was turned off with an additional script that triggers, when the voltage or temperature drops below a threshold.
Screenshot from 2024-12-12 10-43-09
Screenshot from 2024-12-12 10-44-38
image

@ohAnd
Copy link
Owner

ohAnd commented Dec 12, 2024

hi @pitrade ,


at first to the error codes:

  • error code 210 on both days at nearly the same time (00:00:58 <-> 00:00:53) - there is no second timestamp - means warning is active and there are no data (currently both data = 0) - means no additonal e.g. voltage value is given => that should belong to "[PV2 no input]" - as an assupmtion too.
  • error code 218 almost the same but 5 min later (1st 00:05:58 - 2nd 00:05:53) - active warning at the time of screenshot, but with addtional data1 - this is 220 / 10 => 22.0 V and should be the min voltage level for the input PV2; data0 prints then the seen voltage level at the input (small bug here - with wrong interpreting 0 here) - so we cann assume here "[PV2 input undervoltage]"
  • error code 124 you got on 11.12. at 9:45 and on 12.12. 01:07 - with your controlling by HA script - was the inverter shutted down at this time - means PowerLimitSet = 0? - so can we assume this belongs to the message "[Shut down by remote control]"? (interessting - on my side I got 8316 for "[Inverter remote off - active]")
  • error code 16508 - from 1st day - was active between 00:01:22 and 09:05:34 - can we assume that during this time the inverter was in state off (by given PowerlimitSet = 0)? (on my side I got 28796 for an "[Inverter was remote off - period]")

second - the "turned on for no reason" :

from code perspective i can currently not see a cause fur turning on the inverter if powerlimitset = 0 will be received or not changed on mqtt broker side - means it have to be a value > 0 given to send the inverter on request

maybe a side effect:
could it be that the dtuGateway made a reboot at this time (power failure, local watchdog)?
currently the inverter state is internally On after booting and will be set to off with the given warning information (when the right error code is known - see above ;-) )
-> but this is only the local state ... with the "known" error code it will be then set to off with the first receiving of this code.

at this time it is diffcuilt to find the problem - it has to be supervised to get more infos of the surrounding circumstances
(with snapshot before 2.1.0066/2.1.0067- the problem was not given?)

@pitrade
Copy link
Author

pitrade commented Dec 18, 2024

@ohAnd I agree with your assumptions regarding the warnings. I got a new one today. Error code 72 with data0: 5051 and data1: 5020 should be related to the power reduction on high grid frequencies defined in VDE-AR-N 4105. I suggest to add a sensor for the grid frequency which the inverter already monitors.
Screenshot from 2024-12-18 10-19-45

The issue that the inverter turns on at midnight still persists and this did not happen with previous versions. Exactly at 00:00 the inverter turns on with a production that matches the last active limit. The web interface shows a limit of 0% but a production >> 0 W and the DTU state shows "dtu rebooting" as you suspected. You have to set the limit to >0% and back to 0% after the dtu reboot to turn the inverter off again
image

@ohAnd
Copy link
Owner

ohAnd commented Dec 19, 2024

Hi @pitrade ,

regarding the warnings I made some refoctoring in the recent snapshots - I also integrated the frequency warning - including the publication of the grid frequency to HA. Please check.

To the reactivate thing: which snapshot you are currently using with this wrong bahavior? (with the assumption that the snapshot n-1 worked for you) I will check then.
maybe side effect: Do you have cloud pause activated? - means 0,15,30,45 will be a short active disconnect to the dtu so that uploading of data is on dtu side not disturbed...
That it's happen exactly at 0:00 ... has to be investigated. ;-)

In one of the recent snapshots I've also added the real check of inverter status, means when the warning is active and the local inverter state is ON then it will set according to the feedback of dtu and vice versa. That should prevent undefined states locally. Means if there is still the powerlimitset of 0 given and the local state says inverter is off, but the dtu shows the warning "inverter is on" then the difference leads to an active set inverter off command to the dtu.
(could be not the root cause, but should be limit unexpected behaviours)

So, give it a try!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants