victronenergy / dynamic-ess

MIT License
76 stars 5 forks source link

[Bug]: Frequent periods of full power feed-in although feed-in is not allowed #66

Closed beliffm closed 9 months ago

beliffm commented 9 months ago

Contact Details

beliffm@gmail.com

VRM portal ID

c0619ab0327f

Country / region

Germany (de)

B max

28

TB max

6.5

FB max

4.5

TG max

0

FG max

2.5

Battery costs

0.05

Buy price

(p1.03+0.15)1.19

Sell price

default (greyed out)

feed-in possible

no

feed-in possible

no

Version

0.13

What happened?

After start of the flow the Ess feeds-in full throttle for some seconds an then stops and recharges the batterys. This repeats frequently but not regularly every 5 to 15 minutes. As can be seen in the log excerpt both values &feed_in_possible=true&feed_in_control_on=true although unselected during data input. After initially being green (OK) the Dynamic-ESS flow shows red (Invalid VRM Token) a lot but not all the time.

2023-09-16 17_32_07-Remote Console on LAN – Mozilla Firefox

Relevant log output

@400000006505caa633702cbc 16 Sep 17:32:44 - [warn] [victron-dynamic-ess:Wick81-Dyn-ESS] [object Object]
@400000006505caa633cd8b14 curl -X GET -H "Accept:application/json" -H "Content-Type:undefined" -H "X-Authorization:Token 845288a9671082140368e2d98cbca83b740f470686079560ae205a5cba5e5ae7" -H "User-Agent:dynamic-ess/0.1.3" "https://vrm-dynamic-ess-api.victronenergy.com?vrm_id=c0619ab0327f&b_max=28&tb_max=6.5&fb_max=4.5&tg_max=0&fg_max=2.5&b_cost=0.04&buy_price_formula=(p*1.03+0.15)*1.19&sell_price_formula=(p-0.03+0.13)*1.21&feed_in_possible=true&feed_in_control_on=true&country=DE"
@400000006505caa633d9857c curl -X GET -H "Accept:application/json" -H "Content-Type:undefined" -H "X-Authorization:Token 845288a9671082140368e2d98cbca83b740f470686079560ae205a5cba5e5ae7" -H "User-Agent:dynamic-ess/0.1.3" "https://vrm-dynamic-ess-api.victronenergy.com?vrm_id=c0619ab0327f&b_max=28&tb_max=6.5&fb_max=4.5&tg_max=0&fg_max=2.5&b_cost=0.04&buy_price_formula=(p*1.03+0.15)*1.19&sell_price_formula=(p-0.03+0.13)*1.21&feed_in_possible=true&feed_in_control_on=true&country=DE"
@400000006505caa633df2eb4 curl -X GET -H "Accept:application/json" -H "Content-Type:undefined" -H "X-Authorization:Token 845288a9671082140368e2d98cbca83b740f470686079560ae205a5cba5e5ae7" -H "User-Agent:dynamic-ess/0.1.3" "https://vrm-dynamic-ess-api.victronenergy.com?vrm_id=c0619ab0327f&b_max=28&tb_max=6.5&fb_max=4.5&tg_max=0&fg_max=2.5&b_cost=0.04&buy_price_formula=(p*1.03+0.15)*1.19&sell_price_formula=(p-0.03+0.13)*1.21&feed_in_possible=true&feed_in_control_on=true&country=DE"
@400000006505caa633e4bc94 curl -X GET -H "Accept:application/json" -H "Content-Type:undefined" -H "X-Authorization:Token 845288a9671082140368e2d98cbca83b740f470686079560ae205a5cba5e5ae7" -H "User-Agent:dynamic-ess/0.1.3" "https://vrm-dynamic-ess-api.victronenergy.com?vrm_id=c0619ab0327f&b_max=28&tb_max=6.5&fb_max=4.5&tg_max=0&fg_max=2.5&b_cost=0.04&buy_price_formula=(p*1.03+0.15)*1.19&sell_price_formula=(p-0.03+0.13)*1.21&feed_in_possible=true&feed_in_control_on=true&country=DE"
@400000006505caa633e95844 curl -X GET -H "Accept:application/json" -H "Content-Type:undefined" -H "X-Authorization:Token 845288a9671082140368e2d98cbca83b740f470686079560ae205a5cba5e5ae7" -H "User-Agent:dynamic-ess/0.1.3" "https://vrm-dynamic-ess-api.victronenergy.com?vrm_id=c0619ab0327f&b_max=28&tb_max=6.5&fb_max=4.5&tg_max=0&fg_max=2.5&b_cost=0.04&buy_price_formula=(p*1.03+0.15)*1.19&sell_price_formula=(p-0.03+0.13)*1.21&feed_in_possible=true&feed_in_control_on=true&country=DE"
@400000006505caa633edd4b4 curl -X GET -H "Accept:application/json" -H "Content-Type:undefined" -H "X-Authorization:Token 845288a9671082140368e2d98cbca83b740f470686079560ae205a5cba5e5ae7" -H "User-Agent:dynamic-ess/0.1.3" "https://vrm-dynamic-ess-api.victronenergy.com?vrm_id=c0619ab0327f&b_max=28&tb_max=6.5&fb_max=4.5&tg_max=0&fg_max=2.5&b_cost=0.04&buy_price_formula=(p*1.03+0.15)*1.19&sell_price_formula=(p-0.03+0.13)*1.21&feed_in_possible=true&feed_in_control_on=true&country=DE"
@400000006505caa633f287d4 curl -X GET -H "Accept:application/json" -H "Content-Type:undefined" -H "X-Authorization:Token 845288a9671082140368e2d98cbca83b740f470686079560ae205a5cba5e5ae7" -H "User-Agent:dynamic-ess/0.1.3" "https://vrm-dynamic-ess-api.victronenergy.com?vrm_id=c0619ab0327f&b_max=28&tb_max=6.5&fb_max=4.5&tg_max=0&fg_max=2.5&b_cost=0.04&buy_price_formula=(p*1.03+0.15)*1.19&sell_price_formula=(p-0.03+0.13)*1.21&feed_in_possible=true&feed_in_control_on=true&country=DE"
@400000006505caa633f6d94c curl -X GET -H "Accept:application/json" -H "Content-Type:undefined" -H "X-Authorization:Token 845288a9671082140368e2d98cbca83b740f470686079560ae205a5cba5e5ae7" -H "User-Agent:dynamic-ess/0.1.3" "https://vrm-dynamic-ess-api.victronenergy.com?vrm_id=c0619ab0327f&b_max=28&tb_max=6.5&fb_max=4.5&tg_max=0&fg_max=2.5&b_cost=0.04&buy_price_formula=(p*1.03+0.15)*1.19&sell_price_formula=(p-0.03+0.13)*1.21&feed_in_possible=true&feed_in_control_on=true&country=DE"
@400000006505caa633fb26dc curl -X GET -H "Accept:application/json" -H "Content-Type:undefined" -H "X-Authorization:Token 845288a9671082140368e2d98cbca83b740f470686079560ae205a5cba5e5ae7" -H "User-Agent:dynamic-ess/0.1.3" "https://vrm-dynamic-ess-api.victronenergy.com?vrm_id=c0619ab0327f&b_max=28&tb_max=6.5&fb_max=4.5&tg_max=0&fg_max=2.5&b_cost=0.04&buy_price_formula=(p*1.03+0.15)*1.19&sell_price_formula=(p-0.03+0.13)*1.21&feed_in_possible=true&feed_in_control_on=true&country=DE"
@400000006505caa633fff16c curl -X GET -H "Accept:application/json" -H "Content-Type:undefined" -H "X-Authorization:Token 845288a9671082140368e2d98cbca83b740f470686079560ae205a5cba5e5ae7" -H "User-Agent:dynamic-ess/0.1.3" "https://vrm-dynamic-ess-api.victronenergy.com?vrm_id=c0619ab0327f&b_max=28&tb_max=6.5&fb_max=4.5&tg_max=0&fg_max=2.5&b_cost=0.04&buy_price_formula=(p*1.03+0.15)*1.19&sell_price_formula=(p-0.03+0.13)*1.21&feed_in_possible=true&feed_in_control_on=true&country=DE"
@400000006505caa63403d19c curl -X GET -H "Accept:application/json" -H "Content-Type:undefined" -H "X-Authorization:Token 845288a9671082140368e2d98cbca83b740f470686079560ae205a5cba5e5ae7" -H "User-Agent:dynamic-ess/0.1.3" "https://vrm-dynamic-ess-api.victronenergy.com?vrm_id=c0619ab0327f&b_max=28&tb_max=6.5&fb_max=4.5&tg_max=0&fg_max=2.5&b_cost=0.04&buy_price_formula=(p*1.03+0.15)*1.19&sell_price_formula=(p-0.03+0.13)*1.21&feed_in_possible=true&feed_in_control_on=true&country=DE"
@400000006505caa704f9df54 16 Sep 17:32:45 - [warn] [victron-dynamic-ess:Wick81-Dyn-ESS] AxiosError: Request failed with status code 401

Screenshots

![DESCRIPTION](LINK.png)
dirkjanfaber commented 9 months ago

A http code 401 means "unauthorized". Do you have the VRM access token correct?

See https://github.com/victronenergy/dynamic-ess#create-an-access-token

beliffm commented 9 months ago

Access token is correct but the indicator in the flow is all over the place. Sometimes it is green (OK), sometimes it is yellow (Trying to update too quickly...) and most of the time it is red (Invalid VRM token) Maybe due to trying to update too frequently the updates get blocked.

dirkjanfaber commented 9 months ago

Updating too quickly indeed blocks on the API side. Also there is no need to update more frequently (calculations are being updated every 15 minutes IIRC).

beliffm commented 9 months ago

Mind You, the (too) high update rate was not induced by me, i installed the dynamic-ess flow according to the instructions provided.

Von: Dirk-Jan Faber @.> Gesendet: Dienstag, 19. September 2023 14:10 An: victronenergy/dynamic-ess @.> Cc: beliffm @.>; Author @.> Betreff: Re: [victronenergy/dynamic-ess] [Bug]: Frequent periods of full power feed-in although feed-in is not allowed (Issue #66)

Updating too quickly indeed blocks on the API side. Also there is no need to update more frequently (calculations are being updated every 15 minutes IIRC).

— Reply to this email directly, view it on GitHub https://github.com/victronenergy/dynamic-ess/issues/66#issuecomment-1725389664 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AUSTKSQ4ZDCP4X3VWZ7TWTTX3GDSPANCNFSM6AAAAAA4267UAU . You are receiving this because you authored the thread.Message ID: @.***>

dirkjanfaber commented 9 months ago

In that case the red should not be shown. The yellow one I've seen before (but could not locate the cause yet). Did you re-import the flow after the last update?

beliffm commented 9 months ago

Since i never used the previous versions, there should only be the latest one.

dirkjanfaber commented 9 months ago

Ok, thanks for clarifying. Let me re-open the issue and I'll ask a colleague to take a look at the API logging for your site.

beliffm commented 9 months ago

While you are at it, it seems to me that only the first input of the configuration is considered. Any subsequent changes are discarded. And the feed-in flags are always true, regardless of the input. Not sure whether that is another issue though.

dirkjanfaber commented 9 months ago

That is the issue that I've been looking into for the last hour. About to release an update for that.

dirkjanfaber commented 9 months ago

Released the update. Should be available via the palette manager shortly (it sometimes takes a few hours until the Node-RED cache has been updated).

Can you update and check if that fixes your problem?

beliffm commented 9 months ago

Will do.

beliffm commented 9 months ago

Looks good! Changes are deployed, feed-in flags are set to the values i put in. And even the update rate seem to be in order now, the indicator is solid green, only interrupted by a short yellow (Retrieving setpoint) every now and then. I have injected the enable command and keep watching.

beliffm commented 9 months ago

I changed the selling price to test before i sent the comment above and it seemed to be OK by then. What i found now is that all three test values are sent round-robin by the flow now. Looks like they all get stored. I pasted the debug output below, where you can see all three values without my interference.

19.9.2023, 22:34:49node: Wick-Dyn-Essmsg : Object object url: "https://vrm-dynamic-ess-api.victronenergy.com" options: object vrm_id: "c0619ab0327f" b_max: "28" tb_max: "6.5" fb_max: "4.5" tg_max: "0" fg_max: "2.5" b_cost: "0.04" buy_price_formula: "(p1.03+0.15)1.19" sell_price_formula: "0.5" feed_in_possible: "false" feed_in_control_on: "false" country: "DE" headers: object 19.9.2023, 22:39:22node: Wick-Dyn-Essmsg : Object object url: "https://vrm-dynamic-ess-api.victronenergy.com" options: object vrm_id: "c0619ab0327f" b_max: "28" tb_max: "6.5" fb_max: "4.5" tg_max: "0" fg_max: "2.5" b_cost: "0.04" buy_price_formula: "(p1.03+0.15)1.19" sell_price_formula: "(p-0.03+0.13)1.21" feed_in_possible: "false" feed_in_control_on: "false" country: "DE" headers: object 19.9.2023, 22:40:38node: Wick-Dyn-Essmsg : Object object url: "https://vrm-dynamic-ess-api.victronenergy.com" options: object vrm_id: "c0619ab0327f" b_max: "28" tb_max: "6.5" fb_max: "4.5" tg_max: "0" fg_max: "2.5" b_cost: "0.04" buy_price_formula: "(p1.03+0.15)*1.19" sell_price_formula: "0.2874" feed_in_possible: "false" feed_in_control_on: "false" country: "DE" headers: object

dirkjanfaber commented 9 months ago

This is no good; How do you have your deploy set? To all nodes or to the modified nodes?

image
beliffm commented 9 months ago

Full.... could it be that i should have deployed only the changed ones? And by deploying full i duplicated the whole flow?

dirkjanfaber commented 9 months ago

No, I was looking at the wrong thing. I should have focused on the timers more, where the actual bug was. It handled cleaning up the used timers wrong. I've just released 0.1.5, so please update once more.

beliffm commented 9 months ago

Did the update just now. Then i made a change to the configuration. The new configuration was uploaded to Victron immediatedly. The next setpoint retrieval was exactly 12 minutes afterwards. Nothing else in the meantime.

dirkjanfaber commented 9 months ago

That is very good to hear. Closing this issue. If something new pops up, please open a new one.