AskoHeat plus / Solarmanager Askoma Energie manager

Dear all Hello
I need to appologize, if I have not used the correct Category to place my rewuest and question.
I´m pretty new in Home assistand and I also have not really a clue how to Edit or create any code for Home assistand.

I like to integrate my Solar ( PV) inverter with all parameters from Huawei.
in addition I have an Askoma Heat heating device plced in my Water buffer.

Now I have allready tryed to integrate the Solar ( Huawei) all worked good and easy.
There was one Issue, if all was connected, the Data was not longer availeble in the Askoma APP, where I could see production and consumption from House and Heating device. If I disable it in Home assistant data is back inside the APP.

Now my question will be, if there is any one here Who is also using an Askoma Heating devive in combination with my Solar.

Itwill be nice if some one is having an Idea.

Many thanks in advance
Timo

Use ModeBus in order to control your ASKOHEAT+ (connect ASKOHEAT+ with ethernet). You can use automation to send command:

modbus:
  - name: "Resistenza Boiler"
    #close_comm_on_error: true
    delay: 5
    timeout: 5
    type: tcp
    host: 192.168.1.15
    port: 502
    sensors:
      - name: "Boiler Temperatura Interna"
        scan_interval: 15
        data_type: float32
        input_type: input
        unit_of_measurement: °C
        address: 325
        device_class: temperature
        #count: 2
        precision: 1
        scale: 1
      - name: "Resistenza Boiler Consumo"
        scan_interval: 15
        data_type: uint16
        input_type: input
        unit_of_measurement: W
        device_class: power
        slave: 1
        address: 625
      - name: "Resistenza Boiler Lv Potenza"
        scan_interval: 15
        data_type: uint16
        input_type: input
        slave: 1
        address: 318

or use the external API of solarmanager
Solar Manager External API (solar-manager.ch)
You find there all different informations that you know from the app.
then you can create sensor with restful like:

- resource: https://cloud.solar-manager.ch/v1/info/sensor/64afe69befd4f3376603db85
  method: GET
  scan_interval: 240
  timeout: 20
  headers:
    accept: application/json
    Authorization: Bearer {{ states('sensor.sm_accesstoken') }}
  sensor:
    - name: "sm_charging_mode"
      value_template: >
        {% if value_json is defined and value_json.data is defined %}
          {{ value_json.data.chargingMode }}
        {% else %}
          none
        {% endif %}

the calls for the tokens are in external API swagger explained…

HI There many thanks for your help and Support.
Unfortunally I´m a rookey in this thinks, and need some help to implement this code.
Is there a chance that you can give me some guidance ?

Many thanks
Timo

I just managed to get this working. First you create a script:

alias: Boiler - PTH
sequence:
  - service: modbus.write_register
    metadata: {}
    data:
      address: 202
      slave: 1
      hub: Askoma
      value: >-
        {{ [65535, max(0, min(65535, 65535 +
        states('sensor.shellypro_total_active_power') | int))] | min }}
description: ""
icon: mdi:water-boiler

The 65535 is 0 in the weird formatting of int16 in modbus.
So you essentially ADD the total power flowing out or coming in to your house.
I have the shelly for that reporting negative numbers for export and positive for import.

The rest of the value definition is to make sure that it stays in the bounds allowed for int16 (should not be necessary, but if you don’t do that, HA throws an error.

Now this value (available power) gets sent to address 202 of your askoma heater.
It should then automatically select the right heating level within the bounds of available surplus power.

To trigger it, you create an automation:

alias: Boiler PTH
description: ""
trigger:
  - platform: time_pattern
    seconds: /15
condition: []
action:
  - service: script.turn_on
    metadata: {}
    data: {}
    target:
      entity_id: script.boiler_pth
  - service: script.toggle
    metadata: {}
    data: {}
    target:
      entity_id: script.boiler_pth
mode: single

The /15 triggers the automation every 15 seconds. Askoma evaluates sent values ever 5 seconds, so you can also send this every second.

Adjustment has some delay, because Askoma limits switching on/off heater elements to preserve the relais from too much wear and tear.

hope that helps!

I have two askoheat+ devices turning on automatically if my PV produces enough power, and I was able to integrate (read) the sensors (temperatur, power) via modbus in home assistant. Now I would like to add a switch to be able to turn off the device. Can anybody help me with that? The following code is not working for the switch:

# Modbus Integration Askoma Heizschwert Warmwasser WW
modbus:
  - name: "Askoma Warmwasser WW"
    #close_comm_on_error: true
    delay: 5
    timeout: 5
    type: tcp
    host: 192.168.0.24
    port: 502
    sensors:
      - name: "Asko WW Temperatur"
        scan_interval: 15
        data_type: float32
        input_type: input
        unit_of_measurement: °C
        address: 325
        device_class: temperature
        #count: 2
        precision: 1
        scale: 1
      - name: "Asko WW Leistung"
        scan_interval: 15
        data_type: uint16
        input_type: input
        unit_of_measurement: W
        device_class: power
        slave: 1
        address: 317
    switches:
      - name: "Asko WW Switch"
        address: 200
        write_type: coil
        input_type: holding
      - name: "Asko Register1"
        address: 11
        command_on: 1
        command_off: 0
        verify:
            input_type: holding
            address: 127
            state_on: 25
            state_off: 1

I was in touch with the manufacturer and if i got them correctly, you cannot switch the heater on or off via modbus. it might work through REST?

What i did instead:
2 numbers in HA to set temperatures for minimum and temperature for “power to heat” - mode and submit the spare-energy every second.

to turn off askoheat i just reduce the numbers respectively and it stops heating :slight_smile:
see above for implementation.

Try to set up 2 things:
a script to send the modbus command, and an automation to trigger it once you change the value:

Set Minimum Temperature: it will keep this no matter if you have solar or not.
I have set this to 25 degrees so the heater doesnt run at night:

alias: Boiler Set Min
sequence:
  - action: modbus.write_register
    metadata: {}
    data:
      hub: Askoma
      address: 595
      slave: 1
      value: |
        {{ states('input_number.boiler_temp_min') | int }}
description: Send the boiler minimum temperature to Modbus
icon: mdi:water-boiler

The script to set the “Power to heat” temperature (i have that at 55).
Askoma will try to reach that, if enough power is produced by solar.

alias: Boiler Set PTH
sequence:
  - action: modbus.write_register
    metadata: {}
    data:
      hub: Askoma
      address: 597
      slave: 1
      value: |
        {{ states('input_number.boiler_temp_pth') | int }}
description: Send the boiler PTH  temperature to Modbus
icon: mdi:water-boiler


The last script you need, sends the spare energy you have to askoma (see in my former post.

Now we need to somehow trigger these scripts. So i created 2 values as “helpers” and everytime i change them, an automation triggers to send them to askoma on modbus:

to set power to heat → see former post.

to change the minimum temp and PTH temp (power to heat), use this:

alias: Set Boiler Temps
description: ""
trigger:
  - platform: state
    entity_id:
      - input_number.boiler_temp_min
      - input_number.boiler_temp_pth
condition: []
action:
  - action: script.toggle
    metadata: {}
    data: {}
    target:
      entity_id:
        - script.new_script_2
        - script.boiler_set_pth
mode: single

This automation sends the 2 values set above to askoma. i guess you can use the same pattern to send anything to the unit.

Thank you for this very helpful code. I am still struggling, because I have two askoheat+ devices. Which part of the script refers to the device? If I define 2 different modbus “names” in configuration.yaml , do I use the same name in the scripts after “hub:” ? One of my devices is “master” one is “slave”, does this matter in the scripts?

I found the problem myself. “Hub” is the same as “name” in my case. It’s working!

I’ve create a custom integration for askoheat+ devices with the following advantages compared to a manual configuration based on the core modbus integration:

  • All available entities are generated out of the box
  • The entities are grouped in different device units and queries in different intervals so the load to the modbus device is lower
  • The integration provides an additional switch to use energy fed back to the grid to heaten up the water

You can add the integration by adding the github repository GitHub - toggm/askoheat: AskoHeat+ integration to Home Assistant as a custom repository to HACS.

Feel free to start a discussion in that repository.