dm82m / hass-Deltasol-KM2

Custom component for retrieving sensor information from Resol KM1/KM2, DL2/DL3, VBus/LAN, VBus/USB
MIT License
25 stars 6 forks source link

Support for KM1 #33

Closed MikeatLorne closed 1 year ago

MikeatLorne commented 1 year ago

I have a KM1 data communication module hooked up to my solar Hot Water which I am keen to get working with HASS. What plans are there for this device to be supported in addition to the KM2? Extract from logs follows:

2023-08-13 12:53:35.855 INFO (SyncWorker_3) [custom_components.deltasol] Auto detecting Resol product from http://192.168.86.250/cgi-bin/get_resol_device_information 2023-08-13 12:53:35.940 DEBUG (SyncWorker_3) [custom_components.deltasol] response: vendor = "RESOL" product = "KM1" serial = "001E66420C92" version = "2.2.0" build = "201610180602" name = "KM1-001E66420C92" features = "vbus" 2023-08-13 12:53:35.940 INFO (SyncWorker_3) [custom_components.deltasol] Detected Resol product: km1 2023-08-13 12:53:35.940 ERROR (SyncWorker_3) [custom_components.deltasol] We detected your Resol product as km1 and this product is currently not supported. If you want you can file an issue to support this device here: https://github.com/dm82m/hass-Deltasol-km2/issues/new/choose

with thanks

chiefdeputy commented 1 year ago

Hi, as your device is not directly supported, you can try to use the vbus (which the KM1 should expose) connection. See: https://github.com/dm82m/hass-Deltasol-KM2#vbuslan-and-vbususb

You'll need an additional addon which listens to vbus messages and publishes the data via a webserver. This component can then use this webserver to create entities in home assistant.

Note that there currently is a bug which prevents the component from working after a reboot of your home assistant machine. As the addon takes more time to run than the component tolerates, a soft restart of home assistant core is necessary after every reboot.

MikeatLorne commented 1 year ago

thanks for the help with this but I have met a roadblock.

I am getting this log

s6-rc: info: service s6rc-oneshot-runner: starting s6-rc: info: service s6rc-oneshot-runner successfully started s6-rc: info: service fix-attrs: starting s6-rc: info: service fix-attrs successfully started s6-rc: info: service legacy-cont-init: starting s6-rc: info: service legacy-cont-init successfully started s6-rc: info: service legacy-services: starting s6-rc: info: service legacy-services successfully started --- VERSIONS --- add-on version: 0.0.6 nodejs version: v20.5.1 npm version: 9.8.0 --- DEVICES --- ls: cannot access '/dev/ttyUSB': No such file or directory ls: cannot access '/dev/ttyACM': No such file or directory --- json-live-data-server --- debug: Starting server... debug: Connect to VBus data source... error: Main function returned with error: error: undefined

please point me in the right direction. I am sure it is something simple and I have done (or not done) something stupid.

I have tinkered with the sample config file and not that it has a password for the KM1 but not a username - might this be the cause?

cheers

On Fri, 18 Aug 2023 at 17:11, chiefdeputy @.***> wrote:

Hi, as your device is not directly supported, you can try to use the vbus (which the KM1 should expose) connection. See: https://github.com/dm82m/hass-Deltasol-KM2#vbuslan-and-vbususb

You'll need an additional addon which listens to vbus messages and publishes the data via a webserver. This component can then use this webserver to create entities in home assistant

— Reply to this email directly, view it on GitHub https://github.com/dm82m/hass-Deltasol-KM2/issues/33#issuecomment-1683457788, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQEIO6TUHZL52H5OXA6H6KDXV4IRXANCNFSM6AAAAAA3OK37OU . You are receiving this because you authored the thread.Message ID: @.***>

-- Michael Brooks

MikeatLorne commented 1 year ago

using glances, I can confirm that the server is running.

I have installed the required files in custom components and I have the following in my config:

sensor:

but cannot see any entities etc - closer but no solution yet!

On Sat, 19 Aug 2023 at 13:15, Michael Brooks @.***> wrote:

thanks for the help with this but I have met a roadblock.

I am getting this log

s6-rc: info: service s6rc-oneshot-runner: starting s6-rc: info: service s6rc-oneshot-runner successfully started s6-rc: info: service fix-attrs: starting s6-rc: info: service fix-attrs successfully started s6-rc: info: service legacy-cont-init: starting s6-rc: info: service legacy-cont-init successfully started s6-rc: info: service legacy-services: starting s6-rc: info: service legacy-services successfully started --- VERSIONS --- add-on version: 0.0.6 nodejs version: v20.5.1 npm version: 9.8.0 --- DEVICES --- ls: cannot access '/dev/ttyUSB': No such file or directory ls: cannot access '/dev/ttyACM': No such file or directory --- json-live-data-server --- debug: Starting server... debug: Connect to VBus data source... error: Main function returned with error: error: undefined

please point me in the right direction. I am sure it is something simple and I have done (or not done) something stupid.

I have tinkered with the sample config file and not that it has a password for the KM1 but not a username - might this be the cause?

cheers

On Fri, 18 Aug 2023 at 17:11, chiefdeputy @.***> wrote:

Hi, as your device is not directly supported, you can try to use the vbus (which the KM1 should expose) connection. See: https://github.com/dm82m/hass-Deltasol-KM2#vbuslan-and-vbususb

You'll need an additional addon which listens to vbus messages and publishes the data via a webserver. This component can then use this webserver to create entities in home assistant

— Reply to this email directly, view it on GitHub https://github.com/dm82m/hass-Deltasol-KM2/issues/33#issuecomment-1683457788, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQEIO6TUHZL52H5OXA6H6KDXV4IRXANCNFSM6AAAAAA3OK37OU . You are receiving this because you authored the thread.Message ID: @.***>

-- Michael Brooks

-- Michael Brooks

MikeatLorne commented 1 year ago

I managed to get this from the deltasol logs

023-08-19 14:20:33.934 INFO (SyncWorker_1) [custom_components.deltasol] Auto detecting Resol product from http://127.0.0.1:3333/cgi-bin/get_resol_device_information 2023-08-19 14:20:33.939 DEBUG (SyncWorker_1) [custom_components.deltasol] response: vendor = "RESOL" 2023-08-19 14:20:33.939 INFO (SyncWorker_1) [custom_components.deltasol] Detected Resol product: dl2 2023-08-19 14:20:33.939 DEBUG (SyncWorker_1) [custom_components.deltasol] Retrieving data from dlx 2023-08-19 14:20:33.939 DEBUG (SyncWorker_1) [custom_components.deltasol] DLX requesting sensor data url http://127.0.0.1:3333/dlx/download/live 2023-08-19 14:20:33.942 DEBUG (SyncWorker_1) [custom_components.deltasol] DLX response: {'headersets': [{'timestamp': 1692417393.389, 'packets': []}], 'headerset_stats': {'headerset_count': 1, 'min_timestamp': 1692417393.389, 'max_timestamp': 1692417393.389}, 'headers': [], 'language': 'en'} 2023-08-19 14:20:33.943 DEBUG (MainThread) [custom_components.deltasol] Finished fetching deltasol_sensor data in 0.009 seconds (success: True) 2023-08-19 14:20:33.943 DEBUG (MainThread) [custom_components.deltasol] Checking for sensors with old ids in registry.

however, it has only run once - not every 5 minutes as I would have expected.

On Sat, 19 Aug 2023 at 14:10, Michael Brooks @.***> wrote:

using glances, I can confirm that the server is running.

I have installed the required files in custom components and I have the following in my config:

sensor:

  • platform: deltasol host: 127.0.0.1:3333

but cannot see any entities etc - closer but no solution yet!

On Sat, 19 Aug 2023 at 13:15, Michael Brooks @.***> wrote:

thanks for the help with this but I have met a roadblock.

I am getting this log

s6-rc: info: service s6rc-oneshot-runner: starting s6-rc: info: service s6rc-oneshot-runner successfully started s6-rc: info: service fix-attrs: starting s6-rc: info: service fix-attrs successfully started s6-rc: info: service legacy-cont-init: starting s6-rc: info: service legacy-cont-init successfully started s6-rc: info: service legacy-services: starting s6-rc: info: service legacy-services successfully started --- VERSIONS --- add-on version: 0.0.6 nodejs version: v20.5.1 npm version: 9.8.0 --- DEVICES --- ls: cannot access '/dev/ttyUSB': No such file or directory ls: cannot access '/dev/ttyACM': No such file or directory --- json-live-data-server --- debug: Starting server... debug: Connect to VBus data source... error: Main function returned with error: error: undefined

please point me in the right direction. I am sure it is something simple and I have done (or not done) something stupid.

I have tinkered with the sample config file and not that it has a password for the KM1 but not a username - might this be the cause?

cheers

On Fri, 18 Aug 2023 at 17:11, chiefdeputy @.***> wrote:

Hi, as your device is not directly supported, you can try to use the vbus (which the KM1 should expose) connection. See: https://github.com/dm82m/hass-Deltasol-KM2#vbuslan-and-vbususb

You'll need an additional addon which listens to vbus messages and publishes the data via a webserver. This component can then use this webserver to create entities in home assistant

— Reply to this email directly, view it on GitHub https://github.com/dm82m/hass-Deltasol-KM2/issues/33#issuecomment-1683457788, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQEIO6TUHZL52H5OXA6H6KDXV4IRXANCNFSM6AAAAAA3OK37OU . You are receiving this because you authored the thread.Message ID: @.***>

-- Michael Brooks

-- Michael Brooks

-- Michael Brooks

chiefdeputy commented 1 year ago

Seems like the addon cannot connect to the KM1. For reference I attached my config.js located in /config/addon/config.js

/*! resol-vbus | Copyright (c) 2013-present, Daniel Wippermann | MIT license */

const path = require('path');

const config = {

    /**
     * The level of details for log messages.
     * @type {String}
     */
    logLevel: 'debug',

    /**
     * The port number for the HTTP server to listen to.
     * @type {Number}
     */
    httpPort: 3333,

    /**
     * The inteval in milliseconds between two writes of the logging file.
     * @type {Number}
     */
    loggingInterval: 10000,

    /**
     * The filename of the logging file.
     * @type {String}
     */
    loggingFilename: path.resolve(__dirname, 'live-data.json'),

    /**
     * Either 'TcpConnection' or 'SerialConnection' to connect to the VBus.
     * @type {String}
     */
    connectionClassName: 'TcpConnection',

    connectionOptions: {
        /**
         * SerialConnection only:
         * The serial port to which the Vbus/USB device is connected.
         * @type {String}
         */
//        path: '/dev/ttyACM0',

        /**
         * TcpConnection only:
         * The host name / IP address of the VBus/LAN or Datalogger device.
         * @type {String}
         */
        host: '192.168.12.69',

        /**
         * TcpConnection only:
         * The password for the VBus/LAN or Datalogger device.
         * @type {String}
         */
        password: 'vbus',
    },

    /**
     * A map of packet field IDs to their custom name.
     */
    packetFieldNameMap: {
    },

};

module.exports = config;

Replace the host variable with the IP of your KM1.

dm82m commented 1 year ago

Isnt the KM1 providing the same Interface to directly access the json data @chiefdeputy - I am not sure but will ask Daniel about it. If it supports it, it would be easy to add it in the integration. If it is only providing vbus endpoint then the way @chiefdeputy suggestes is the way to go.

MikeatLorne commented 1 year ago

Thank you both. Any progress here will be appreciated.

Michael

dm82m commented 1 year ago

@MikeatLorne okay, KM1 supports no direct access. You need to use the addon as @chiefdeputy already stated.

MikeatLorne commented 1 year ago

thanks Dirk,

I've used the add-on and that is what I am having trouble with.

hoppel118 commented 1 year ago

Hi,

I am using a VBUS-LAN-Adapter and also have to use the addon. It works as expected.

Did you do what @chiefdeputy already suggested here:

https://github.com/dm82m/hass-Deltasol-KM2/issues/33#issuecomment-1685221402

Regards Hoppel

MikeatLorne commented 1 year ago

Thanks all. For some reason, the add-on now appears to be working (green light) but the deltasol integration is not working. I’ve reinstalled it and restarted HASS a number of times without success. Should it automatically appear in the integrations page or have I missed a step? (I’ve added the additional lines to my config file too)

dm82m commented 1 year ago

Please Post the logs of the addon aswell as the logs of home assistant all lines beginning with deltasol and enable debug logging before

hoppel118 commented 1 year ago

Should it automatically appear in the integrations page or have I missed a step?

No there is no entry in the integrations nor in the device page. You have to look for deltasol entities. Here is my feature request for it:

https://github.com/dm82m/hass-Deltasol-KM2/issues/24

There is also another issue. The sometimes sometimes starts before the addon is ready, when you start or reboot your HAOS. You have to restart HAOS after a reboot. Look here:

https://github.com/dm82m/hass-Deltasol-KM2/issues/30

MikeatLorne commented 1 year ago

resol-vbus logs:

s6-rc: info: service s6rc-oneshot-runner: starting s6-rc: info: service s6rc-oneshot-runner successfully started s6-rc: info: service fix-attrs: starting s6-rc: info: service fix-attrs successfully started s6-rc: info: service legacy-cont-init: starting s6-rc: info: service legacy-cont-init successfully started s6-rc: info: service legacy-services: starting s6-rc: info: service legacy-services successfully started --- VERSIONS --- add-on version: 0.0.6 nodejs version: v20.5.1 npm version: 9.8.0 --- DEVICES --- ls: cannot access '/dev/ttyUSB': No such file or directory ls: cannot access '/dev/ttyACM': No such file or directory --- json-live-data-server --- debug: Starting server... debug: Connect to VBus data source... error: Main function returned with error: error: undefined

deltasol logs from home assistant core:

2023-08-27 06:57:53.180 INFO (SyncWorker_0) [custom_components.deltasol] Auto detecting Resol product from http://127.0.0.1:3333/cgi-bin/get_resol_device_information 2023-08-27 06:57:53.184 DEBUG (SyncWorker_0) [custom_components.deltasol] response: vendor = "RESOL" product = "DL2" serial = "001E66000000" version = "2.1.0" build = "201311280853" name = "DL2-001E66000000" features = "vbus,dl2" 2023-08-27 06:57:53.184 INFO (SyncWorker_0) [custom_components.deltasol] Detected Resol product: dl2 2023-08-27 06:57:53.184 DEBUG (SyncWorker_0) [custom_components.deltasol] Retrieving data from dlx 2023-08-27 06:57:53.184 DEBUG (SyncWorker_0) [custom_components.deltasol] DLX requesting sensor data url http://127.0.0.1:3333/dlx/download/live 2023-08-27 06:57:53.186 DEBUG (SyncWorker_0) [custom_components.deltasol] DLX response: {'headersets': [{'timestamp': 1693032214.453, 'packets': []}], 'headerset_stats': {'headerset_count': 1, 'min_timestamp': 1693032214.453, 'max_timestamp': 1693032214.453}, 'headers': [], 'language': 'en'} 2023-08-27 06:57:53.186 DEBUG (MainThread) [custom_components.deltasol] Finished fetching deltasol_sensor data in 0.006 seconds (success: True) 2023-08-27 06:57:53.187 DEBUG (MainThread) [custom_components.deltasol] Checking for sensors with old ids in registry.

I think my problem remains in the Resol VBus addon - I have tried different passwords in the json config file without success.

here is the config file

/! resol-vbus | Copyright (c) 2013-present, Daniel Wippermann | MIT license /

const path = require('path');

const config = {

/**
 * The level of details for log messages.
 * @type {String}
 */
logLevel: 'debug',

/**
 * The port number for the HTTP server to listen to.
 * @type {Number}
 */
httpPort: 3333,

/**
 * The inteval in milliseconds between two writes of the logging file.
 * @type {Number}
 */
loggingInterval: 10000,

/**
 * The filename of the logging file.
 * @type {String}
 */
loggingFilename: path.resolve(__dirname, 'live-data.json'),

/**
 * Text file logging interval in milliseconds. A value of zero disables

this functionality. */ textLoggingInterval: 0,

/**
 * Text file logging time to live in milliseconds.
 */
textLoggingTimeToLive: 60000,

/**
 * Text file logging directory.
 */
textLoggingPath: path.resolve(__dirname, 'log'),

/**
 * Text file logging options, passed to the `TextConverter` constructor.
 */
textLoggingOptions: {
    columnSeparator: '\t',
    lineSeparator: '\r\n',
    separateDateAndTime: false,
},

/**
 * Either 'TcpConnection' or 'SerialConnection' to connect to the VBus.
 * @type {String}
 */
connectionClassName: 'TcpConnection',

connectionOptions: {
    /**
     * SerialConnection only:
     * The serial port to which the Vbus/USB device is connected.
     * @type {String}
     */
    path: '/dev/ttyACM0',

    /**
     * TcpConnection only:
     * The host name / IP address of the VBus/LAN or Datalogger device.
     * @type {String}
     */
    host: '192.168.86.250',
    /**
     * TcpConnection only:
     * The password for the VBus/LAN or Datalogger device.
     * @type {String}
     */
    password: 'admin',
},

/**
 * A map of packet field IDs to their custom name.
 */
packetFieldNameMap: {
    '00_0010_7E11_10_0100_000_2_0': 'Temperature collector',  //

instead of "Temperater sensor 1" },

/**
 * A list of EM (extension module) sub-addresses to simulate.
 */
emSimulatorSubAdresses: [
    // 1,
    // 2,
    // 3,
    // 4,
    // 5,
],

}; module.exports = config;

with thanks...

On Sat, 26 Aug 2023 at 19:55, hoppel118 @.***> wrote:

Should it automatically appear in the integrations page or have I missed a step?

No there is no entry in the integrations nor in the device page. You have to look for deltasol entities. Here is my feature request for it:

24 https://github.com/dm82m/hass-Deltasol-KM2/issues/24

There is also another issue. The addon sometimes starts before the integration is ready, when you start or reboot your HAOS. You have to restart HAOS after a reboot. Look here:

30 https://github.com/dm82m/hass-Deltasol-KM2/issues/30

— Reply to this email directly, view it on GitHub https://github.com/dm82m/hass-Deltasol-KM2/issues/33#issuecomment-1694246401, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQEIO6SB4J2O5O6EU6PLW4TXXHBY3ANCNFSM6AAAAAA3OK37OU . You are receiving this because you were mentioned.Message ID: @.***>

-- Michael Brooks

dm82m commented 1 year ago

Yes the problem is the addon. This addon is just running another software, so would suggest you to raise your issue there: https://github.com/danielwippermann/resol-vbus/

MikeatLorne commented 1 year ago

I finally solved the problem with the addon. My KM1 had old firmware which I updated - thinking that was the problem. In doing the update, the default password had changed from "Vbus" to "vbus" which I found somewhere in the KM1 instructions! This may only affect people who are doing a complete reset when they update the firmware (which I did). I now have a clean log in the "resol-vbus" addon and appear to have some deltasol information appearing in the HASS logs but am yet to see anything in the form of sensors or an integration showing. thanks to all who have helped so far.

On Sun, 27 Aug 2023 at 16:52, Dirk @.***> wrote:

Yes the problem is the addon. This addon is just running another software, so would suggest you to raise your issue there: https://github.com/danielwippermann/resol-vbus/

— Reply to this email directly, view it on GitHub https://github.com/dm82m/hass-Deltasol-KM2/issues/33#issuecomment-1694587706, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQEIO6QAHGKQRV7ZHEW354TXXLVBNANCNFSM6AAAAAA3OK37OU . You are receiving this because you were mentioned.Message ID: @.***>

-- Michael Brooks

MikeatLorne commented 1 year ago

I think this one can be closed