Giter VIP home page Giter VIP logo

mielesolar's Introduction

Mielesolar

Start Miele@Home appliances when your SolarEdge inverter produces surplus power.

Purpose

Why should you want to use this point-to-point integration between your inverter and household devices when more flexible solutions like openHAB.org, FHEM, ioBroker.net, home-assistant.io, etc. exist?

  • Minimal resource footprint: the Docker image has a compressed size of ~4 MB, the memory usage is ~10 MB.
  • Easy to get started: it's not required to learn abstract concepts like things, connectors, bindings, channels, links, etc. Just provide your inverter's IP address and Miele credentials and that's it.
  • No gateway (XGW3000) required to connect to your Miele devices: mielesolar uses the Miele API to talk to your WiFi-enabled devices.
  • Realtime data: mielesolar does not use the restricted SolarEdge Monitoring API (only 300 requests per day, data resolution of 15 minutes) or unsupported workarounds like scraping the monitoring platform, but talks to your inverter directly over the local network. This is fast and provides realtime data.

Usage

1. Enable MODBUS over TCP on your inverter

This can be done without opening the inverter. See documentation.

2. Get Miele API credentials

The tool uses the Miele 3rd Party API to communicate with your appliances and requires API credentials to do so. You can request access at https://www.miele.com/f/com/en/register_api.aspx. Pass the obtained credentials and your Miele@Home account through MIELE_USERNAME, MIELE_PASSWORD, MIELE_CLIENT_ID, and MIELE_CLIENT_SECRET environment variables to mielesolar.

3. Run mielesolar

There are several options to run the tool on a variety of machines, including Raspberry Pi or common NAS hardware. Set the vg parameter to the locale where you registered your Miele@Home account, e.g. de-DE or de-CH.

Native

go install github.com/ingmarstein/mielesolar
MIELE_USERNAME=xxx MIELE_PASSWORD=xxx MIELE_CLIENT_ID=xxx MIELE_CLIENT_SECRET=xxx mielesolar -inverter $IP -port 502 -vg de-DE -auto 500

In a container

docker run --env MIELE_USERNAME=xxx --env MIELE_PASSWORD=xxx --env MIELE_CLIENT_ID=xxx --env MIELE_CLIENT_SECRET=xxx ingmarstein/mielesolar -inverter $IP -port 502 -vg de-DE -auto 500

Alternatively, use the included docker-compose.yml file as a template if you prefer to use Docker Compose.

On a Synology NAS

Add the Mielesolar Synology Package Source
  1. Open Package Center in DSM and select the Settings option.
  2. Select the Package Sources tab.
  3. Click Add
  4. In the Name section enter Mielesolar
  5. In the Location section enter https://ingmarstein.github.io/mielesolar/
  6. Click OK
Install Mielesolar
  1. Go back to Package Center and search for Mielesolar
  2. Click on the Mielesolar package then select Install
  3. Click Agree when warned about using a package from an unknown publisher
  4. Click Done to confirm installation
  5. Provide the configuration parameters
mielesolar.conf

If you upgrade your existing Mielesolar package, no changes will be made to the mielesolar.conf file. If you want to overwrite your mielesolar.conf configuration with the default one, please uninstall and install the package again.

You can customize the configuration of Mielesolar by using the config file at /var/packages/mielesolar/target/mielesolar.conf.
Please stop the package before changing the configuration.
If you have edited the configuration while Mielesolar is running, please restart the Mielesolar package.

4. Start your Miele appliance

When starting your dishwasher, washing machine, tumbler, etc. use the "SmartStart" option which delays the start of a program until enough solar power is generated or until a specified time, whichever comes first. If this is not available, enable the SmartGrid option. mielesolar will find the devices in the PROGRAMMED_WAITING_TO_START state and start them whenever your SolarEdge inverter signals sufficient power generation.

Advanced configuration

A configuration file can be used to define a priority order in which to launch the appliances and to customize their power consumption.

In order to use the configuration file, don't use the -auto parameter which otherwise defines a common power consumption value for all appliances and replace it with -config $file using the following format:

[
  {
    "id": "000xxxxxxxxx",
    "name": "Washing Machine",
    "power": 200
  },
  {
    "id": "000yyyyyyyyy",
    "name": "Tumble Dryer",
    "power": 500
  }
]

The order of the devices defines the priority, i.e. the order in which the devices are started if the inverter produces surplus power. In the example above, if 600 W power is available, mielesolar would start the first device consuming 200 W, but the remaining 400 W are not enough to also start the second.

The power values don't need to be exact and should be chosen large enough to not start the devices too early.

A device's identifier is also called "serial number" or "fabnumber" and can be found in the Miele@Home app (include the leading zeros).

mielesolar's People

Contributors

dependabot-preview[bot] avatar dependabot[bot] avatar ingmarstein avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

mielesolar's Issues

Add delay option

Just had the following situation:

It's a rainy/cloudy day today, the battery is empty and the solar production is low. I set the dishwasher and two washing machines to "SmartStart" after loading them. The devices all require almost similar power, so it doesn't make a difference if I use the auto option or the devices.json.

When a cloud moved away, the solar production jumped for a few minutes, enough to hit the trigger value.
All 3 machines were started in a second, but as they need a few minutes to hit their real consumption (influx of water before heating) they now exceed the solar production a lot.

How about a delay option to be set in seconds in the command line options so that the program waits e.g. 300 seconds before triggering a second device?

Machines start early

Hi again,

normally, machines used to atart when there was an excees power of x Watts. Now with my current setup and the current version, machines start when the solar production reaches value x, not regarding house consumption

Jul 23 08:01:42 RaspberryPi mielesolar[30476]: 2023/07/23 08:01:42 Inverter DC Power: 129
Jul 23 08:01:42 RaspberryPi mielesolar[30476]: 2023/07/23 08:01:42 Inverter AC Power: 127
Jul 23 08:01:42 RaspberryPi mielesolar[30476]: 2023/07/23 08:01:42 Meter AC Power: 783.00
Jul 23 08:01:42 RaspberryPi mielesolar[30476]: 2023/07/23 08:01:42 Battery Power: 0.000000
Jul 23 08:01:47 RaspberryPi mielesolar[30476]: 2023/07/23 08:01:47 Inverter DC Power: 129
Jul 23 08:01:47 RaspberryPi mielesolar[30476]: 2023/07/23 08:01:47 Inverter AC Power: 127
Jul 23 08:01:47 RaspberryPi mielesolar[30476]: 2023/07/23 08:01:47 Meter AC Power: 805.00
Jul 23 08:01:47 RaspberryPi mielesolar[30476]: 2023/07/23 08:01:47 Battery Power: 0.000000
Jul 23 08:01:47 RaspberryPi mielesolar[30476]: 2023/07/23 08:01:47 starting device  (0001
Jul 23 08:01:47 RaspberryPi mielesolar[30476]: 2023/07/23 08:01:47 started device  (00017

Delayed start

Hi,

I switched from running the native app to running it in a docker container. Works good.
Only thing I noticed: When no machines are running and the conditions for a smartstart trigger are met, the first start is delayed by the chosen delay interval (300 sec) though it could as well start immediately. Not a big issue, just wanted to mention it.

Load balancing with batteries

Hi,
Until niw, I have a simple setup wirhout batteries. But these will be installed in rhe next days.
So I wonder ifvtherevis a kind of power management and how thus affectsbthus plugin. If course Id want my Machines to start before batteries are being loaded...but is this already managalbe?

Machines do not start

Okay, today I finally had the opportunity to test the functionality.
Situation: 4 Miele devices (1 dishwasher, 2 washing machines, 1 tumble dryer), all Miele@home- and SmartGrid enabled.

Set the Dishwasher to "SmartStart". App shows "Verzögerter Start" (delayed start).

Raspi is running with the mielesolar app as a service.

 [Unit]
 Description=Mielesolar
 After=multi-user.target

 [Service]
 Type=idle
 ExecStart=/usr/local/go/src/mielesolar/mielesolar -user '[email protected]' -password 'password' -client-secret 'secret' -client-id 'id' -vg de-DE -inverter 192.168.0.170 -config /usr/local/go/src/mielesolar/devices.json -verbose
 Restart=always
 RestartSec=3

 [Install]
 WantedBy=multi-user.target

The devices.json looks like this:

[
  {
    "id": "000xxx",
    "name": "Geschirrspüler",
    "power": 500
  },
  {
    "id": "000xxx",
    "name": "Waschmaschine links",
    "power": 1000
  },
  {
    "id": "000xxx",
    "name": "Waschmaschine rechts",
    "power": 1000
  },
  {
    "id": "000xxx",
    "name": "Trockner",
    "power": 500
  }
]

So, the dishwasher should start with 500 watts of excess solar power. Currently, I have an excess of between >1 to >4kW.

The Names of the machines in the devices.json are the same as in the app.

Output of "systemctl status -n50 mielesolar"

redacted

Machine does not start.... :-(

Add threshold value to start all devices

Currently, advanced config allows to start different devices in an order when a set value of surplus solar power is reached.

I have 2 washing machines, 1 tumble dryer and a dishwasher. If I set realistic values for peak power consumption, the last device would never start (~2,5kW for washing machines, ~1,4 kW for dishwasher, ~0,6 kW for Tumble dryer). Of course I can set lower values, but that would result in too early starts when just one machine is programmed. Further, the machines do not need peak power during all the time.
So, maybe we can have an option to start all machines at once when a given threshhold value is reached. Or have 2 values to group machines (e.g. put one high- and one low-consuming machine in a group) and start groupwise.

Handling of EV chargers

Hi,

since last year, I now have my electric vehicle. Of course I want to use the solar power to charge it, but I would like it to charge from the surplus power only if possible. Now, this of course causes all the power to go into the car, so the inverter will not see excess power going to the grid or battery.
And of course there are several different types of wallboxes or other chargers, so I wonder (and have limited ideas) if there is any value you could use to determine this and prefer starting washing machines etc.
One idea would be to push values via MQTT. But you would actually need at least 2 values: Charging mode (and this will be different in naming over several manufacturers) and charging power. Else, if there is no excess solar power and you choose "charge from grid" bc you need your car charged, this would lead to triggering a machine start.

Any ideas on that? or too much to work?
If I had the possibility to trigger the machine's start from Home Assistant (which I do not have) I could simply replace everything through automations, as all values (PV, machines, wallbox, car) are present there....

Cannot run this program, help is appreciated

Hi,

this is exactly what I am looking for. I have a SmartGrid enabled tumbler and washing machine and a SolarEdge inverter.

Now I'd like to make use of smartStart. I have not found a solution for home assistant.

Unfortunately, I am no too much into programming and your instructions failed me.

I try to run this on a Raspi 3B.

First I tried "go get" which told me that "get" was deprecated and I should use "install" instead. Did so, but calling the package failed with "is not in GOROOT folder".

Second I tried docker run, which gave me

WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm/v7) and no specific platform was requested
exec /mielesolar: exec format error

I'd really appreciate help in running this.
Further, can I start it up automatically on the raspi's reboot?

Thanks for your time.

Crashes when Miele Servers unavailable

Yesterday, Miele had a scheduled server maintenance from 10pm-2am.
The service on my raspi crashed with this result:

sudo systemctl status mielesolar
● mielesolar.service - Mielesolar
     Loaded: loaded (/lib/systemd/system/mielesolar.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Tue 2023-01-31 23:01:28 CET; 13h ago
    Process: 1368 ExecStart=/usr/local/go/src/mielesolar/mielesolar -user [email protected] -password password>
   Main PID: 1368 (code=exited, status=2)
        CPU: 2min 40.218s


Jan 31 23:01:28 RaspberryPi mielesolar[1368]:         /home/pi/mielesolar/server.go:227 +0x28
Jan 31 23:01:28 RaspberryPi mielesolar[1368]: main.(*server).refresh(0xca0000)
Jan 31 23:01:28 RaspberryPi mielesolar[1368]:         /home/pi/mielesolar/server.go:157 +0x64
Jan 31 23:01:28 RaspberryPi mielesolar[1368]: main.(*server).serve(0xca0000)
Jan 31 23:01:28 RaspberryPi mielesolar[1368]:         /home/pi/mielesolar/server.go:65 +0x68
Jan 31 23:01:28 RaspberryPi mielesolar[1368]: main.main()
Jan 31 23:01:28 RaspberryPi mielesolar[1368]:         /home/pi/mielesolar/main.go:111 +0x5d0
Jan 31 23:01:28 RaspberryPi systemd[1]: mielesolar.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
Jan 31 23:01:28 RaspberryPi systemd[1]: mielesolar.service: Failed with result 'exit-code'.
Jan 31 23:01:28 RaspberryPi systemd[1]: mielesolar.service: Consumed 2min 40.218s CPU time.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.