You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 162 Next »



Note, use the test version to get the latest:  https://homey.app/no-no/app/no.bwa.easy-charger/Easy-Charge-Controller/test/

But usually, you would use: https://homey.app/no-no/app/no.bwa.easy-charger/Easy-Charge-Controller

Release notes :

  • v1.2.0: NEW: Emergency mode to handle charging if Car App is offline
  • v1.1.0: NEW: feature for enabling debuglogging. IMPROVEMENT: better calculation of charge statistics. And bugfixes


This page will be updated regularly, so visit it regularly

 


There is more to come. Stay tuned. And remember, this is freeware, don't expect more than you would expect to get for nothing. There is always a way to contribute, though.

Implemented features

  • Small step charging. You can choose to charge only 1 or 2 or a few hours, maybe because the hours with low prices are less than you need to reach the target SoC.
  • Notifications. If an important thing is happening, you will get a notification for it.
  • Charger Control Strategy. Use the built-in scheduler in the charger (i.e. Easee) as a configurable option. This is probably more robust than trusting the cloud commands in real time.
  • Support for different power grid prices during the day/night/weekend.
  • Support for the Norwegian Power Subsidy feature ("Strømstøtte" = 90% of hourly spot price over 0.70 NOK refunded).
  • Optional to add tax and additional fixed cost to the final price.
  • Generic error handling and logging.

Planned features

  • Ability to set upper level in power price, either in absolute amount or as a percentage of this day's average.
  • Notifications. If errors occur or if price is low or high, to either remind you to charge your car or to advice you not to.




Contents


Introduction

What it is and what it is not

Homey Easy Charge Controller is a Homey App that can control your existing Homey Charger App (i.e. EaseeHome) based on Nordpool prices, your preferences, and input from your existing Homey Car App (e.g. myAudi or Polestar App for Homey). It is intended to be 'wired' with Homey Flows or Advanced Flows to get information from other sources and to control other Homey Apps and Devices.

From this point on, ECC stands for Easy Charge Controller

When a Controller device is created, you should initialize it with some setup. In the drawing below, all components are shown.

Overview picture

The mandatory components are drawn in green color. 


The minimum setup

The minimum setup is ECC and a Homey App for your charger. The Homey Car App is optional, but in most cases you will probably have this as well.

Using the minimum setup you must manually update the current SoC and target SoC using the Easy Charger App sliders. The daily electricity prices are downloaded from Nordpool at 13.30 every day.

The typical setup

The typical setup is ECC, a Homey App for your charger, and a Homey Car App.

Using this setup, you can send the current SoC and Target SoC automatically to ECC by connecting the Car App to ECC using flows. In some cases, for example for the Polestar app, target SoC is not available, but you can create a Homey variable representing the target SoC setting in the vehicle, and create a flow to send this to ECC when the variable changes. 


Getting started

  1. Install the app from App Store.
  2. Then add a new Device, select Easy Charge Controller and the Controller device.
  3. Select Connect.
  4. You should get one Charge Controller device.
  5. Add it.
  6. You should see it like this: 
  7. Go to settings and select your price zone, price setting, and other parameters you may want to change.
  8. Finally, you must create the mandatory flows, either the flows for charging strategy "Local Scheduler".
  9. And add the optional flows of your choice.
  10. Happy charging!


Mandatory Flows for any charger strategy

The absolute minimum flow setup is as follows: 

Starting and stopping the charger need to be wired so ECC can start and stop charging when the plan is due. If you only do this, you must set the current Soc and target Soc manually. Read more in the how to operate the App section.

Additional Mandatory Flows for Charger Strategy Local Scheduler

These flows are only needed if you have an Easee Home Charger and want to utilize the Local Scheduler Strategy.

The ECC needs to be able to set a charge-plan and delete it, so you need to add these two flows.


Send schedule to the charger

This will fire when the car is connected, and the strategy is "Local Scheduler". It will also fire when important settings are changed, for example, when the charging target SoC is altered.

Delete schedule

This will fire when a scheduled charging session is completed, or car is disconnected, and the strategy is "Local Scheduler".




About your Charge Robot

The charge robot I'm using is Easee, but most Charge Robots will works as long as they have a Homey App. Here is the list of known Charge Robot Apps for Homey

  • Easee HomeSupports Local Scheduler.
  • Zaptech Go. Does not support Local Scheduler.
  • Wallbox Charger. Does not support Local Scheduler.
  • Garo. It does not seem to have a lot of features. But it may be able to be started or stopped by Homey. In that case, it may work.
  • Go-e Charger. Does not support Local Scheduler.
  • ChargeAmps-HALO. Does not support Local Scheduler.

It seems like Easee is still the king of charging robots.


If you don't have any Homey App to manage your charger, it may even be possible to utilize ECC if you can stop or start charging with your Homey App for your Car. Some examples will be provided in the future. Stay tuned.

Did I miss a charge robot? Notify me ...



How to operate the App


The Controller Panes


To turn on or off your charger control process. It will still load prices, and retrieve status information, but it will not start or stop the carger even if the schedule is due.

The two sliders to manually control current SoC or the target SoC





The two dropdowns to control the amount of charge and when charging should finish by.

Here's the first thing you need to be aware of. If 'Use Charge End' time is selected, the controller will use Current SoC, Target SoC, Battery Capacity, Nominal Charge Speed, and the current time to decide the hours it will enable charging.

If you select, for example, 3 hours, the Controller will choose the 3 cheapest hours between now and the Charge End time to enable charging. 

Note: If the car is not connected, the time of now will be used in the calculation, but if the car is connected, then the hours will be recalculated from the time of the car connecting and the Charge End time. This is quite obvious, as the cheapest hour may be passed, and if the Car was not connected at that time, it cannot be used, so the 3 cheapest hours from the car Connect time and Charge End time will be used.



The next pane is long but nice. It shows all you need to know about what the Controller plans to do. This is the main functionality of the App. There are a lot of smart chargers out there, but no one is telling in advance the detailed charging plan it has created. This App does.

So, the first row is about the current SoC and target SoC.

The next is showing the charge speed ( you set this with the settings tab ) and the Charge End time

Next is the count of hours to charge. If 0, it means use end time and current SoC, and the calculation result is shown as 00:24 in this picture. The Controller only uses whole hours when controlling, so the Start Charge Command will happen at the start of the hour, and the End Charge Command will execute at the next hour. In the case of 00:24, it rounds up to the next whole hour.

If you choose, for example, 3 hours, the number will show here, and that amount will be selected. The calculated Charge Time is meant to help you set the amount, if that is what your preference. Sometimes, you may only want to charge for 2 hours. Well, here you can do that.

Nest is current (ampere) and and power (watt) that your charger is set to use. Due to grid pricing strategies in some countries, this is frequently set lower than the maximum that the charger can deliver. This is to inform you if you would like to know. The ability to provide such information is one of the motivations for developing the App...

And last, there is one row for each hour, from 13.00 today to 12.00 tomorrow. This is the mean feature of Easy Charge Controller. The left is Yes or - (dash), and the right is the price for those hours. So you can see the hours ECC plans to enable charging on and what will happen from now to tomorrow at 13.00 when new Nordpool prices are loaded.

The amount in parentheses is the price support for the current hour (in øre). The price used is the resulting actual price. Most values are intuitive. The Average charge speed and Charging session duration are experimental for the time being.


This is a sample of one hour where a charge session is planned to happen. By intention, "No" is a dash and not "No". This is because it is easier to differentiate the Charge hours from the No Charge hours.


When you change the charge end time or the number of charge hours, a recalcation will occur.


You can create as many devices as you want to have different targets to control. You can even control charger at home and at your cabin, if you have both chargers available in Homey as Apps and they ar cloud ready, such as the Easee charge robot. 


Settings

Initial setting

Some initial setting, Battery Capacity. The net Battery Capacity. You must estimate the effective charging speed value, as the charge calculator will use that to calculate a charge-plan.
The Charger strategy is described here.

The value for Stop charging if the target is passed is used if you want ECC to stop an active charging session if the current SoC is updated and is above the set target SoC. It will require connection to the Charger App, so it's not guaranteed. But it might be useful if you want to have the car set to a higher target, or maybe not even possible to adjust without being present in the car. So this is an option for anyone who might find this useful.



Price settings

If you want to take into account tax, additional fees, or power grid fee, just fill in the values. You may also want to check/uncheck the option for compensation for the Norwegian price subsidy program. If that is checked, all prices will be adjusted by subtracting the amount of subsidy each hour.

Put 0 (zero) inn all fields to act on raw prices only.

Note To achieve real cheapest price calulation algorithm demands to enter values for at least Power grid feeif it's different during the day or night (or weekend). And the Norwegian price subsidy (support) should be checked.


Charge status mapping

Default are values for Easee Home charger.

Easy Charge Controller is using some local status codes, initially set for Easee. Other chargers need to map their statuse values to match. This describes how the app uses each value:

Easy Charger Controller expected status valuesExplanation
ChargingThe car is charging
CompletedThe car is finished charing, but still connected to the charger
PausedCar is connected but is not charging, the charging sessin is stopped by Easee App or Easy Charge Controller
StandbyNo car connected, charger is up and ready
Car connectedCar connected, charging session not started yet, probably the status will change to Charging is short time


How to connect the dots

The section above explains how to set up the different values such that ECC can select which hours to charge during the next 24 hours.


When cards


Controller turned on / off

Optional card, use if you need something to happen when the ECC is started or stopped.

Controller was started

This is the advice for the Controller was started card. It will gather the Charger status, and SoC values from your Car.


Create a charging schedule

 This will fire when ECC has created a new charge schedule. Will only work for Easee Charger and with Charge Strategy Local Scheduler.

Yo must create a HomeyScript to have this working, because the Easee Home will not access flow tags. You will find a working script here.

Delete current charging schedule

This will fire when ECC thinks you will not need the schedule any more. Currently this is when :  

  • Car is disconnected
  • A new charging plan is created
  • If important settings are changed that will alter the charge plan of if you select a different Charge Strategy.

Prices have been updated

This is very optional. But if you need to know, this is how you do it.

Charging status is requested

It is recommended to wire this. Sometimes ECC needs to get the Charger status, and you can wire the Status tag from your Charger here. Note that it's not a flow tag, but a propety tag from the Charger. ( Easee Hjemme - Status) in this case.

Start charging session

You should connect Start charging session to the Turn On action flow card for your charger.

Stop charging session

You also should connect the Stop charging session to the Turn Off action flow card.

 

Someting bad happened

Well, it may happen, then you can log it.


Then cards



Update current 'State of Charge' (SoC)


Update target 'State of Charge' (SoC)


Update status with [charger-status]


Update current ampere [current-ampere]

Update current power [current-power]

Update current powermeter [power-meter] powermeter chargesession [power-meter-session]


Error Handling and Logging

The is a flow card for handling errors as you prefer.

This is an example of how to push error and details to a Google Spreadsheet with Homey Easy Logger.



Example how to send logs to a Google Spreadsheet with Easy Logger and catch errors to also log them in the spreadsheet.

Enable more details in diagnostics

If you check the checkbox as shown below in device settings, more detail sin diagnostics will be enabled. Any restart is not needed.

Be aware that this will produce more logging, and the diagnostic report has a limited size, so the contents of the diagnostics will contain data for a much smaller time period.


So it's advicable to enable this ahead of sending a diagnositic. Often this migth be requested by the developer.

Features

Charger Strategy

If your charger has a built in scheduler available in the Homey App, this is the most reliable option for charging strategy. With that option enabled, every new charging schedule will be sent to the charger when you create it (via the cloud, but if that fails you will get a message and retry). Later, at night in most cases, when the charger has planned to charge, it will execute, even if it is offline. So this is the most reliable solution, if your charger supports it.


If strategy is Cloud Commands, the Easy Charger will execute the start and stop commands in real time, and if the charger is offline, the charge session will fail. It's rare to happen, but is known to happen when it's most problematic, e.g. before an important early morning long journey. That is as per Murphys Law.

Car Offline Emergency charging

Note: If you dont have any reliable source to enable this automatic feature, just leave it unused. It's not mandatory to do this, it's just an option for those that can utilize it.


This is a special mode used if ECC learns that the car is not online anymore. If this happes, unless you are using ECC in all manual mode, ECC will switch to emergency mode where a fixed amount of hours are used. You must set this value to a amount that will ensure you enough charge duration. The default value is 5 hours, but your preferred value  must be set. It depends on the power your charger delivers. If you can charge with 11 kW your value may be low, but if your charge speed is only 3.6 kW you may want more hours. It's important to adjust this value, if you want an optimal emergency charge plan.


To set the amount of emergency hours, select the dropdown named as Offline charging hours and pick a value that suits you 


So how will ECC know if your car is offline or online ?


There is 2 sources to that information

  • Manual switch
    • There is a button where you may press to toggle Online state.

      This is how Car is online = true looks like:



      This is how Car is online = false looks like:




  • Flowcard from your Car App
    • If there is a way to let your car notify ECC that is is online, ECC has a flow card to receive this notification.
    • You will then connect the event from Car App that fires at regular intervals when car is online, and you must put a value in the parameters to the flow card. This value is an amount of minutes ECC should wait before it can expect to receive the next notification. Let us say you put 30 as in 30 minutes, then 30 minutes after ECC got the notification and no new "car is alive" notification occurs, ECC will go into emergecy mode.

      This is an example of connecting the myAudi updated event to the Car is online flow card. With a parameter of 30 minutes:



    • How to set a reasonable parameter ? It MUST be a value which is more minutes than you have set ut the Car App to report in. In the above example the myAudi App is set to a reporting interval of 15 minutes, so in theory 16 minutes should be fine, but it's recommended have some slack. Then ECC will not switch to emergency mode too frequently. In above example a value of 30 minutes could be a good value. But you need to experiment with this to find a value that does not trigger emergency mode unless required. 
    • You will get a notification if this happens, as this example shows:



    • You will also get a notification if the car reports in again, as shown in this example



  • Important to know about this mode:
    • If car is offline mode is set manually, it will stay in that mode permanently until you exit the mode manually by pressing the Online/Offline button again.
    • So the manual mode overrides any automatic mode. The "Car is online" button will show car is offline, just as if you set offline manually, but ECC will save 'who' did it, so this is just to let you know the car is offline regardless of the source of that information.
    • You will also se a sligthly different count of hours when emergency mode is active. The count of hours is prefixed with Offline:


All manual mode

In this mode you must set current Soc and target Soc manually using the sliders. It is important to enter correct values, if you want accurate charge durations.

Handle charging when Car App is offline

From v1.2.0

If you don't have a car app, you must update SoC values manually using sliders in ECC app to inform ECC what you want to achieve, and in that case, this section is of no relevance for you

ECC requires SoC data (current SoC and target SoC) from the Homey App for your car. But what if the Car or Car App is offline ? ECC will not be able to obtain the recent SoC updates.



Homey Scripts


In addition you need to create a Homey Script to transform the start and stop time hashtags to real values. Thsi is due to a missing feature in Easee Charger App. But hey, this is Homey, you can fix it easily yourself.

NOTE! You must find your device id, see script for it below. 

createEaseeChargerSchedule.js

createEaseeChargerSchedule.js - For Homey 2019
try {

  console.log("createEaseeChargerSchedule args", args);

  const obj = JSON.parse(args);

  await Homey.flow.runFlowCardAction({
    uri: 'homey:device:your-device-id-here',
    id: 'createSchedule',  
    args: {
      'startTime': ''+obj.start,
      'endTime': ''+obj.stop,
      'repeat': true
    }
  });

} catch (err) {
  throw Error("Error occured with createEaseeChargerSchedule : " + err + " args: '" + args + "'");
}




createEaseeChargerSchedule.js - For Homey 2023
try {
 
  console.log("createEaseeChargerSchedule args", args);

  const obj = JSON.parse(args[0]);

  await Homey.flow.runFlowCardAction({
    uri: 'homey:easee:home',
    id: 'homey:device:your-device-id-here:createSchedule',
    args: {
      'startTime': obj.start,
      'endTime': obj.stop,
      'repeat': true
    },
  });

} catch (err) {
  throw Error("Error occured with createEaseeChargerSchedule : " + err + " args: '" + args + "'");
}




find-easee-device-id.js


Create this script and execute it, and you will find the Easee device id

find-easee-device-id.js for any Homey version
const actionCards = await Homey.flow.getFlowCardActions();
for( const card of actionCards ) {
  if(card.id.indexOf('createSchedule')> -1) {
    log(card.titleFormatted || card.title)
    log(JSON.stringify({
      uri: card.uri,
      id: card.id,
      args: card.args,
      droptoken: card.droptoken,
      duration: card.duration,
    }, false, 2));

  }
}



Enable Push Notifications

Some notifications are important, so it's advised to add Push notifications to Easy Charge Controller. Otherwise it will only show up in timeline.

Set it here :

Utilize Homey Easy Logger

This app has a companion in Homey Easy Logger that will help you obtain even more information about Homey events.

Case 1. Status logging.

I have set up a Flow card to push important events to my Google Spredsheet by using Homey Easy Logger. As one example below.


This is this evening I returned to home and connected the car to my Easee Charger. The Charger starts charging immediate shown at 20:29:07. The Charge Controller receives this status update, and is checking the Schedule. It discovers that this hour is not set for charging, and will issue a stop charge command. That happened 20:29:21, as we see Chargers stop and status resumes to Paused. It also shows that my car is reporting its charge level and Easy Charge Controller will update it's state en recalculate the Charge Schedule.

In this flow I'm utilizing the Easy Logger. Look into Easy Logger documentation how to connect Google Spreadsheet. In the case below I have craeated a Sheet tab with the name of Event Log, and assignet the sheet-id to a variable of SHEET_ID_EVENT_LOG, and always insert the new entry at row 2, and that will push old entries down with the latest entry on top. See picture below. It shows also Time line logging if desired


Example of the EventLog sheet-tab


Topic about Power Balancing

In Norway we have different price tiers for the amount of energy used for one hour, the maximum average kWh for three hours each month. So if you as for example never want to use more than 10 kWh within one hour you need something to control and constrain power usage to achieve this.

Easy Charge Controller is not designed for this. It is not its purpose.

But it will work fine with an electricity supplier such as Tibber. Actually, Tibber has a very well working power constrain feature, but you need to buy electricity from them. I can only recommend this.

So how does this work?

In this example the max is 10 kWh. I'm using Easee and have set up 32A max load. If one-phase it gives 7200 W, using three phase you get 8200W. Normally this is not a problem, but in winter, even at night, other power consumers may run, such as water heating, and some other room heaters. It will possible force the Tibber App to lower the power on the Easee charger. An it will do so. Easy Charge Controller is only turning the Charge Robot on and off, and does not alter the ampere of the Charger.

So how will you solve this ?

Here is how I solve it:

I'm setting the nominal charge speed to somthing lower, because it's only an estimate to for ECC to calculate which hours to charge for. By setting it a bit lower than the maximum, the calculation will add one hour or maybe two, into the charge plan, just to be safe.

The whole idea is to be safe and sure that you car will have completed charging, and you can verify the accuracy of the calculation before it's really happening.

And also the ability to partially charge is now so very easy. If you just want to charge a small amount, you select a couple of hours as per your preference, and the Controller will select those number of cheapest hours to charge.

Practical Use Cases

Here's a collection of practical use cases, some are posted by users, and other users are welcome to add smart innovations to even enhance this marvelous app.

Case: Override button

Contributed by Rune Carlsen

Case: Charge with only Car App

This case will show how you can charge if you car has an app and maybe the carger is a collection of locals inhouse charger for your housing association



  • No labels