Comments (7)
I think a better approach would be to just add functionality to call the charge
and discharge
API endpoints with arbitrary values (and make sure the value passed doesn't exceed the limit of the inverter). This would allow the user to build their own buttons with adjustable values.
That said, currently there is no exposed function for doing either the max charging or an adjustable charge. The implementation is not really straight forward but if time permits I may have a look at it over the next weeks or so.
from ha_sonnenbatterie.
That would be awesome!
Basically I am looking for two functions.
- Send battery to charge from grid
- Toggle the operation state
I am using this nodeRed script to load the battery from grid.
But it has some issues. Solar energy is not detected and added to the price calculation.
And not available variables set the battery to manual mode, which basically blocks the battery from working.
from ha_sonnenbatterie.
If you want to charge or discharge a sonnen battery using node red you can use an http request node.
Something like this to discharge:
[{"id":"05d69d4319a0f5d6","type":"http request","z":"65840aa926d9c567","name":"POST","method":"POST","ret":"obj","paytoqs":"ignore","url":"","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"bearer","senderr":false,"headers":[],"x":1250,"y":400,"wires":[["0e4ea3476743d2c3","7e7a97b8e68d3389"]]},{"id":"6151ac699f7381c1","type":"function","z":"65840aa926d9c567","name":"Discharge Setup","func":"var pospayload = 0.0\npospayload = Math.abs(msg.payload)\nmsg.headers = {}\nmsg.headers['Auth-Token'] = 'YOUR-BATTERY-AUTH-TOKEN'\nmsg.headers [\"Content-Type\"] = \"application/x-www-form-urlencoded\"\nmsg.url = \"http://YOUR-BATTERY-IP-ADDRESS:80/api/v2/setpoint/discharge/\" + pospayload.toString()\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1090,"y":400,"wires":[["05d69d4319a0f5d6"]]}]
Or this to switch to automatic self consumption mode:
[{"id":"b66c43b2d71ebcfc","type":"http request","z":"65840aa926d9c567","name":"PUT","method":"PUT","ret":"obj","paytoqs":"ignore","url":"","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"bearer","senderr":false,"headers":[],"x":1250,"y":220,"wires":[["1736681453a9e3de","81532e458a6da3d1"]]},{"id":"49c07dcad21bb88c","type":"function","z":"65840aa926d9c567","name":"Automatic Mode","func":"msg.payload = \"EM_OperatingMode=2\"\nmsg.headers = {}\nmsg.headers['Auth-Token'] = 'YOUR-BATTERY-AUTH-TOKEN'\nmsg.headers [\"Content-Type\"] = \"application/x-www-form-urlencoded\"\nmsg.url = \"http://YOUR-BATTERY-IP-ADDRESS:80/api/v2/configurations\" \nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1080,"y":220,"wires":[["b66c43b2d71ebcfc"]]}]
Or this to switch to manual mode:
[{"id":"402679171d35e0d2","type":"http request","z":"65840aa926d9c567","name":"PUT","method":"PUT","ret":"obj","paytoqs":"ignore","url":"","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"bearer","senderr":false,"headers":[],"x":1250,"y":280,"wires":[["5bd08bcd972153bc","81532e458a6da3d1"]]},{"id":"9efde64dbc00c864","type":"function","z":"65840aa926d9c567","name":"Manual Mode","func":"msg.payload = \"EM_OperatingMode=1\"\nmsg.headers = {}\nmsg.headers['Auth-Token'] = 'YOUR-BATTERY-AUTH-TOKEN'\nmsg.headers [\"Content-Type\"] = \"application/x-www-form-urlencoded\"\nmsg.url = \"http://YOUR-BATTERY-IP-ADDRESS:80/api/v2/configurations\" \nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1080,"y":280,"wires":[["402679171d35e0d2"]]}]
from ha_sonnenbatterie.
Thanks for your help.
And how can I do that in Home Assistant? NodeRed is working fine and I don't need a button there.
from ha_sonnenbatterie.
Thanks for your help. And how can I do that in Home Assistant? NodeRed is working fine and I don't need a button there.
Have a look here
You'll find all information on how to configure rest commands in HA for controlling your Sonnenbatterie.
from ha_sonnenbatterie.
Yes, you can do the same thing in Home Assistant using RESTful Command or you can simply use the node red home assistant contrib nodes to pass values from HA into node red. This config is native if node red is implemented as a HA add-on as would be the case if you have implemented home assistant using HAOS or supervised (install methods).
I use EMHASS to calculate an energy plan every 60 second and apply the forecast battery SoC to my sonnen battery. I've documented my set up here. You'll find my full node red configuration there in JSON format.
I use a wholesale market energy supplier so my supply tariff and feed-in tariff change constantly inline with the national energy market in Australia and I also manage deferrable loads in the house like pool pump and EV charging using the same system.
from ha_sonnenbatterie.
BTW Home Assistant community discussions on EMHASS are here and here
from ha_sonnenbatterie.
Related Issues (20)
- Error in log: inverter_ststus_fac HOT 3
- Sensor reading total production HOT 8
- I cannot re-install integration HOT 8
- Can't find this integration in the HACS addon HOT 2
- Sonnenbatterie 10: tracking consumption + battery charging HOT 6
- Entities intermittently freeze and get unavailable HOT 9
- Change IP HOT 4
- Sensor Not set HOT 1
- Inverter_ipv2 problem HOT 1
- Fehler HOT 1
- Entities becoming unavailable HOT 2
- Request, not an issue - Show Operating mode HOT 11
- Representation of the “Systemstatus” sensor HOT 4
- Question :: How to connect to Sonnen unit HOT 1
- Error on 75a3e8c update: "The version 75a3e8c for this integration can not be used with HACS." HOT 6
- https://github.com/weltmeyer/ha_sonnenbatterie.git is not a valid add-on repository
- Sensors Stop waorking and values freeze HOT 1
- Some meters report a value of `undefined` when their actual value is `0` HOT 9
- Internal Max Temp and Charge/Discharge status unavailable HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ha_sonnenbatterie.