reyntjensw / Homey-FusionSolar

GNU General Public License v3.0
2 stars 4 forks source link

Control charging based on prices #3

Open mackewigren opened 2 years ago

mackewigren commented 2 years ago

Hi I am about to invest in probably a Huawei inverter. In Homey I know when prices are high and low from my electrical company. Is it possible to control the inverter that when the price is low it should charge instead of having schedules in the inverter? More or less every hour tell the inverter if it is a charging hour or a discharging hour?

reyntjensw commented 2 years ago

@mackewigren from what I know this is not possible. The inverter in my case is only charging with solar power.

You can create a case at Huawei and ask them if the APi has this ability, if so it can be added.

mackewigren commented 2 years ago

@mackewigren from what I know this is not possible. The inverter in my case is only charging with solar power.

You can create a case at Huawei and ask them if the APi has this ability, if so it can be added.

According to documents I have seen it should be possible to charge with schedules. But I guess maybe not controlled via API.

reyntjensw commented 2 years ago

@mackewigren after discussing this with Huawei, there is no way in doing this.

reyntjensw commented 1 year ago

Good morning

From what I know, charging cannot be controlled with the api. The system makes "intelligent" decisions based on the load.

Wouter


Van: mackewigren @.> Verzonden: vrijdag 25 maart 2022 10:03 Aan: reyntjensw/Homey-FusionSolar @.> CC: Subscribed @.***> Onderwerp: [reyntjensw/Homey-FusionSolar] Control charging based on prices (Issue #3)

Hi I am about to invest in probably a Huawei inverter. In Homey I know when prices are high and low from my electrical company. Is it possible to control the inverter that when the price is low it should charge instead of having schedules in the inverter? More or less every hour tell the inverter if it is a charging hour or a discharging hour?

— Reply to this email directly, view it on GitHubhttps://github.com/reyntjensw/Homey-FusionSolar/issues/3, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABDO4YHGKDUFQB5RQGZIFHTVBV6NVANCNFSM5RTRPOAA. You are receiving this because you are subscribed to this thread.Message ID: @.***>

mackewigren commented 1 year ago

Good morning From what I know, charging cannot be controlled with the api. The system makes "intelligent" decisions based on the load. Wouter

Thanks. There are different settings. I have TOU as Operation mode. Then I can define several time slots during the day to control if I should Charge or Discharge. See attached image of example settings. It would be good enough to just have two time slots a day. One for the coming hour and one for the rest. And every hour it should be updated based on a workflow.

It should be possible with MODBUS TCP from what I heard. But I don't know anything about that.

IMG_2500

reyntjensw commented 1 year ago

@mackewigren Thanks for the info. Currently, I'm not sure if I will incorporate ModBus because it seems like they are going to discontinue 3rd party integrations. (https://forum.huawei.com/enterprise/en/forum.php?mod=redirect&goto=findpost&ptid=789585&pid=4632813)

I'll put this one on the backlog

mackewigren commented 1 year ago

Hi

I have had a conversation with Huawei and they didn’t know themselves. But when I asked if they had any plan for adding battery charging control in the API the actually found that version 7 DOES SUPPORT charging. I am not good enough at API but think I understood it as chapter "6.3.6 Interface for Delivering Battery Charge and Discharge Tasks” is about this.

Would be nice if possible to based on any trigger in Home just send ”Start charging” or ”Stop charging”. Or in combination with ”Start charging for x minutes”

What do you think about this? Must be one of the most wanted functions.

Best regards

Marcus

mackewigren commented 1 year ago

Hi, updating this case. Not sure if you got my pdf file in the last update.

As you see below it should nowadays be possible to control charging through the API. This would be very very interesting. I also see that there are more people asking about this.

What do you think about this? For me it would be good enough to be able to set for example two periods at the time. For example

1) Charge between 02:00 and 06:00 (or for how many hours, 02:00 and 4 hours) 2) Discharge between 06:00 and 02:00 (or for how many hours, 06:00 and 20 hours)

Every hour when I get new electric prices from Tibber in my case (or Nordpool) I could let homey send new schedules.

What do you say about this?

Best regards

Marcus

iMaster NetEco V600R022C00 Northbound Interface Reference-V7 (SmartPVMS)....pdf

reyntjensw commented 1 year ago

Hi @mackewigren

It will not be impossible if you are referring to point 6.3.6. They have mixed 2 versions of the api in the documentation.

If the request url includes a port like this one, it is not possible.

image
mackewigren commented 1 year ago

Hi

I am not sure exactly what you mean. You write both ”not impossible” and also ”it is not possible”. I think you mean that it is NOT possible.

Why is it not possible based on a port in the URL? Most of the request urls in the document have port number

Best regards

Marcus

10 nov. 2022 kl. 21:52 skrev Wouter Reyntjens @.***>:

Hi @mackewigren https://github.com/mackewigren It will not be impossible if you are referring to point 6.3.6. They have mixed 2 versions of the api in the documentation.

If the request url includes a port like this one, it is not possible. https://user-images.githubusercontent.com/4648544/201203116-e8b26198-f0b0-4646-a076-edcdabddec27.png — Reply to this email directly, view it on GitHub https://github.com/reyntjensw/Homey-FusionSolar/issues/3#issuecomment-1310878407, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANZQJIOWYYCXJQORD4RRN7DWHVN7HANCNFSM5RTRPOAA. You are receiving this because you were mentioned.

reyntjensw commented 1 year ago

Hi @mackewigren

If you look at the code (https://github.com/reyntjensw/Homey-FusionSolar/blob/main/drivers/luna/api.js#L6) this is the url I am using to do all the calls, it starts with thirdData. This api is publicly available, the one in the document is not reachable, I think it's created for another platform.

mackewigren commented 1 year ago

Hi

I have had the ability to test this now from Postman. And it works. I could trigger battery charging. I use the same credentials but Huawei needed to ”open” access for this version.

So it definitely should be possible. Would you be interested in developing for battery control?

Best regards Marcus


Marcus Wigren 0733-983138 Rosenvägen 5
23735 Bjärred @.***

11 nov. 2022 kl. 15:23 skrev Wouter Reyntjens @.***>:

Hi @mackewigren https://github.com/mackewigren If you look at the code (https://github.com/reyntjensw/Homey-FusionSolar/blob/main/drivers/luna/api.js#L6) this is the url I am using to do all the calls, it starts with thirdData. This api is publicly available, the one in the document is not reachable, I think it's created for another platform.

— Reply to this email directly, view it on GitHub https://github.com/reyntjensw/Homey-FusionSolar/issues/3#issuecomment-1311757821, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANZQJIKHSA4WO26YEXXHLP3WHZJH3ANCNFSM5RTRPOAA. You are receiving this because you were mentioned.

reyntjensw commented 1 year ago

@mackewigren I right now don't have the time to program this. If someone else has the time, please create a PR.

trapeze78 commented 1 year ago

Hi, I have a Homey, recently bought a LUNA inverter and will soon get som Huawei batterier as well. I share the exact same situation as @mackewigren and will follow this thread closely. Not sure if I am able to program this myself but will dig into the API details as soon as everything is up and running. Option would be to run something using a Home Assistant setup or wait for my electricity company Tibber to get it done themselves but that might take a while. Keep up the good work!

boboiusa commented 1 year ago

Hi I have had the ability to test this now from Postman. And it works. I could trigger battery charging. I use the same credentials but Huawei needed to ”open” access for this version. So it definitely should be possible. Would you be interested in developing for battery control? Best regards Marcus ------------------------------------------------------------- Marcus Wigren 0733-983138 Rosenvägen 5 23735 Bjärred @. 11 nov. 2022 kl. 15:23 skrev Wouter Reyntjens @.>: Hi @mackewigren https://github.com/mackewigren If you look at the code (https://github.com/reyntjensw/Homey-FusionSolar/blob/main/drivers/luna/api.js#L6) this is the url I am using to do all the calls, it starts with thirdData. This api is publicly available, the one in the document is not reachable, I think it's created for another platform. — Reply to this email directly, view it on GitHub <#3 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANZQJIKHSA4WO26YEXXHLP3WHZJH3ANCNFSM5RTRPOAA. You are receiving this because you were mentioned.

@mackewigren Hello Marcus. I will soon get my Huawei battery and is was wondering if you have had any more luck regarding smart charging the battery. I am also from Sweden and it would be great to know what is possible with Huawei batteries today.

Cheers, Johan

mackewigren commented 1 year ago

HI boboiusa

I have not tested it more. I dont have enough knowledge on my own I think. But I tested a luttle from Postman just to make sure it is possible through API. But unfortunately I ave not been able to convince the app author to implement this and I have not enough knowledge I think to do it on my own.

I think the only thing the app (or a script) needs to do is

1) Change charge mode. Three different options. Charge, Discharge, Nothing. This can then be triggered through flows

2) Could be nice to set electricity price so it would be possible to see revenue in the Fusion Solar app.

The other settings is probably overdoing it. Feed-to-grid or Feed-to-battery can be changed in the Fusion Solar app is my opinion.

So if you want to try to convince the author, just go on :-)

trapeze78 commented 1 year ago

Hi! +1 on the dream of having this functionality in place!

Even through I have been struggling to get an API account for three months now (Huawei support->installer company->solution vendor Otovo-> Otovos backbone provider -> no answer) without luck so far, I am confident that this too shall pass.

Keep up the good work!

/Marten

Skickat från Outlook för Androidhttps://aka.ms/AAb9ysg


From: mackewigren @.> Sent: Tuesday, March 28, 2023 9:01:10 AM To: reyntjensw/Homey-FusionSolar @.> Cc: trapeze78 @.>; Comment @.> Subject: Re: [reyntjensw/Homey-FusionSolar] Control charging based on prices (Issue #3)

HI boboiusa

I have not tested it more. I dont have enough knowledge on my own I think. But I tested a luttle from Postman just to make sure it is possible through API. But unfortunately I ave not been able to convince the app author to implement this and I have not enough knowledge I think to do it on my own.

I think the only thing the app (or a script) needs to do is

  1. Change charge mode. Three different options. Charge, Discharge, Nothing. This can then be triggered through flows

  2. Could be nice to set electricity price so it would be possible to see revenue in the Fusion Solar app.

The other settings is probably overdoing it. Feed-to-grid or Feed-to-battery can be changed in the Fusion Solar app is my opinion.

So if you want to try to convince the author, just go on :-)

— Reply to this email directly, view it on GitHubhttps://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Freyntjensw%2FHomey-FusionSolar%2Fissues%2F3%23issuecomment-1486320333&data=05%7C01%7C%7C0644451f4f734a83d35a08db2f5a3662%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638155836752939442%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=20MlkeGLCQ5TXujFtZfFf8UYViW%2F7JkMVJsAZET6F%2FY%3D&reserved=0, or unsubscribehttps://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FA5A6E5RSWMNQ4EI57QAEQMLW6KEDNANCNFSM5RTRPOAA&data=05%7C01%7C%7C0644451f4f734a83d35a08db2f5a3662%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C638155836752939442%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=J%2BhmU%2FOSbq%2BUNayWMaveUGMt%2F09B1l5cuyJRFQwmkho%3D&reserved=0. You are receiving this because you commented.Message ID: @.***>

reyntjensw commented 1 year ago

If someone can give me the commands, I can try to implement them.

mackewigren commented 1 year ago

If someone can give me the commands, I can try to implement them.

Hi, I will get back about this in a couple of days. Unless someone else have the time before me. Thanks a lot.

boboiusa commented 1 year ago

Thank you all for trying to get this to work.

Have a nice weekend!

mackewigren commented 1 year ago

Hi WIll this be "good enough" as examples? See attached pdf. Fusion Solar Battery Flow.pdf

reyntjensw commented 1 year ago

@mackewigren thanks for the example, I'm first working on a login issue, when that is solved I'll try to work on this.

mackewigren commented 1 year ago

@mackewigren thanks for the example, I'm first working on a login issue, when that is solved I'll try to work on this.

Just let me know if I can help.

mackewigren commented 1 year ago

@reyntjensw Hi. Wanted to check if you have had any progress with this? We are many that have “requested” this feature. In different threads.

reyntjensw commented 1 year ago

@mackewigren for now this is not on the backlog since the app is not stable. It does not make sense to develop this if the app is not working as expected.