pblxptr / ecoNET-300-Home-Assistant-Integration

ecoNET300 Home Assistant is a custom integration for ecoNET300 devices.
16 stars 6 forks source link

Future. Boiler power kW sensor #13

Closed jontofront closed 9 months ago

jontofront commented 1 year ago

I try to figure how calculate boiler power on time.

I figure out from the boiler supply, that when boiler work (boiler_output). If it's 100% = boiler kW I have 11 kW = 100% (boiler output)

So I make template:

- platform: template
  sensors:
    boiler_power_kwatts:
      unique_id: boiler_power_kwatts
      friendly_name: "Boiler work power kW"
      unit_of_measurement: "kW"
      device_class: power
      value_template: >
        {% set BO = states('sensor.boiler_output_2') | float %}
        {{ ((BO*11)/100) | round(2) }}

image

Now I trying to figure out, maybe we have boiler kW in EcoNET and can integrate sensor in your integration package.

After all winter we will know kW :)

denpamusic commented 1 year ago

Sorry for butting in, but you should be able to access boiler power via following endpoint: http://[EN300 IP]/econet/regParams

This will return following json:

{
  "settingsVer":"...",
  "editableParamsVer":"...",
  "schedulesVer":"...",
  "remoteMenuVer":"...",
  "curr":{
    ...
    "boilerPowerKW":16.0,
    ...
  }
}

Object curr then should contain key boilerPowerKW that is current boiler power in KW. There also should be other keys with self-explanatory names like fanPower.

Other way will be: http://[EN300 IP]/econet/regParamsData

This will return following json:

{"version":"...","data":{...}}

Where data object contains a list of the values with numerical ID's. AFAIK these numerical ID's are different for each EM model, but you should be able to figure out which one is boiler power.

Just wanted to share some knowledge from almost a year of trying to decipher python code from EN300 firmware minified by pyminifier 😅

pblxptr commented 1 year ago

Sorry for butting in, but you should be able to access boiler power via following endpoint: http://[EN300 IP]/econet/regParams

This will return following json:

{
  "settingsVer":"...",
  "editableParamsVer":"...",
  "schedulesVer":"...",
  "remoteMenuVer":"...",
  "curr":{
    ...
    "boilerPowerKW":16.0,
    ...
  }
}

Object curr then should contain key boilerPowerKW that is current boiler power in KW. There also should be other keys with self-explanatory names like fanPower.

Other way will be: http://[EN300 IP]/econet/regParamsData

This will return following json:

{"version":"...","data":{...}}

Where data object contains a list of the values with numerical ID's. AFAIK these numerical ID's are different for each EM model, but you should be able to figure out which one is boiler power.

Just wanted to share some knowledge from almost a year of trying to decipher python code from EN300 firmware minified by pyminifier sweat_smile

Thanks! Your help is always welcome, as I guess, among us you have the best knowledge about EN300 :) And indeed there is a key like this in the data, so I will add it.

denpamusic commented 1 year ago

Thanks! Your help is always welcome, as I guess, among us you have the best knowledge about EN300 :) And indeed there is a key like this in the data, so I will add it.

You're welcome! Glad I could help. My knowledge is mostly of backend, since I decided to approach a problem via "binary route" with my lib:) I can only try to deduce how real EN would respond on certain endpoints, since I don't have a device myself. You do have it though, so I'm really glad that you've decided to develop this integration!👍

jontofront commented 1 year ago

Thanks, @denpamusic I will try. I don't know maybe it helps all of you, I have config and software to update for the boiler. When I bought boiler in software was a lot fo bags. Manufacturers send me configs and software to update boiler. config and software are there: https://github.com/jontofront/Smartfire-IF11 https://github.com/jontofront/Smartfire-IF11/blob/master/InterFire%20IF11%20Condensing%20configuration.xml

jontofront commented 1 year ago

hm bug in my boiler :( ....econet/regParams?

image

pblxptr commented 1 year ago

hm bug in my boiler :( ....econet/regParams?

image

In my case, it's the same but in my boiler also boilerPower in % is always 0.

denpamusic commented 1 year ago

Interesting... Maybe something changed in EN300 firmware, but it's the endpoint that EN300 uses to fetch data for local UI🤔

What about second method with http://[EN300 IP]/econet/regParamsData? From diagnostics data that I collected via feedback at least on EM8xx series, boiler power in kW should be stored under the key 1793 and boiler power in % should be stored under the key 1794.

The main problem that I find with this method, is that I still can't find a way to convert these numeric keys to human-readable names, I suspect it's done on remote :(

jontofront commented 1 year ago

Interesting... Maybe something changed in EN300 firmware, but it's the endpoint that EN300 uses to fetch data for local UI🤔

What about second method with http://[EN300 IP]/econet/regParamsData? From diagnostics data that I collected via feedback at least on EM8xx series, boiler power in kW should be stored under the key 1793 and boiler power in % should be stored under the key 1794.

The main problem that I find with this method, is that I still can't find a way to convert these numeric keys to human-readable names, I suspect it's done on remote :(

For my case: I don't have '1793' '1794' - boiler output (boiler power in percents) '1795' - boiler fan image

@denpamusic I collect some key for @pblxptr in this file

pblxptr commented 1 year ago

Interesting... Maybe something changed in EN300 firmware, but it's the endpoint that EN300 uses to fetch data for local UIthinking What about second method with http://[EN300 IP]/econet/regParamsData? From diagnostics data that I collected via feedback at least on EM8xx series, boiler power in kW should be stored under the key 1793 and boiler power in % should be stored under the key 1794. The main problem that I find with this method, is that I still can't find a way to convert these numeric keys to human-readable names, I suspect it's done on remote :(

For my case: I don't have '1793' '1794' - boiler output (boiler power in percents) '1795' - boiler fan image

@denpamusic I collect some key for @pblxptr in this file

Thanks for the file! The only thing I'm worried about is whether or not these keys vary between firmware versions, eg. in fw v1.0.0 1024 corresponds to boiler temperature whereas in fw v1.1.0 1024 means something else.

denpamusic commented 1 year ago

The only thing I'm worried about is whether or not these keys vary between firmware versions, eg. in fw v1.0.0 1024 corresponds to boiler temperature whereas in fw v1.1.0 1024 means something else.

This is valid concern, but I highly doubt it, since fw version isn't part of the UID response and exchange with econet24 basically starts with the result from this response. You can view some information from this response by accessing getSysParams endpoint in EN300 API.

There regType identifies series (0 - ecoMAX p, 1 - ecoMAX i), and regProd identifies concrete product. I think the identification of device on the remote is done via these two values (possibly even with only regProd). Hence I envision having definitions like these for dealing with regdata:

EconetRegdataEntityDefinition(
   key=1024,
   reg_type=0,
   reg_product=51,
   name="Heating temperature",
   icon="mdi:thermometer",
   native_unit_of_measurement=TEMP_CELSIUS,
   state_class=SensorStateClass.MEASUREMENT,
   device_class=SensorDeviceClass.TEMPERATURE,
)

Then just loop over them, filter only matching specific reg_type and reg_product and call async_add_entities on the result. It's a bit cumbersome, but until someone can figure out a endpoint on econet24 or EN300, that gets us the names, it's probably the best we're going to get.

I believe that Plum treats CurrentData message accessible on EN300 via regParams endpoint as generic data present on most devices, while using RegData message accessible via regParamsData to expand on it with product-specific sensors, so I think something like this can be done in integration as well.

The hard part here is collecting keys and matching them with the product. I'm working on ecoMAX data dump repository for this purpose. Probably will require users to upload their device's data there before requesting new feature...

jontofront commented 1 year ago

This is valid concern, but I highly doubt it, since fw version isn't part of the UID response and exchange with econet24 basically starts with the result from this response. You can view some information from this response by accessing getSysParams endpoint in EN300 API.

I try http://My_local_IP/econet/getSysParams? image

Actually I found some values names: http://econet_local_ip/econet/rmParamsEnums?

denpamusic commented 1 year ago

Sorry my mistake, endpoint is just http://econet_local_ip/econet/sysParams without get.

You other find is great though :)