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

json-live-data-server not working #44

Closed rblumenthal678 closed 3 weeks ago

rblumenthal678 commented 3 weeks ago

Trting to get the Resol DL2 Datalogger integratio workin. I have downloaded all the files and updated the configurations with my local IP address and password, however it appears that the json-live-data-server will not run correctly on my HAOS instance. It starts, the does nothing. No decvies or entities show up. My files as follows:

configuration.yaml

config/addons/config.js host: my_resol_local_IP_address password: my_local_pasword ** curious no variable or constant for username

Logs show the following: 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 cp: cannot stat '/config/addons/config.js': No such file or directory

dm82m commented 3 weeks ago

Can you make a screenshot showing the config.js incl. the folder structure

edit: and default port is 3333 not 333

rblumenthal678 commented 3 weeks ago

Thanks for the quick reply ... yes, port is 3333 (333 was a typo in my queston above).

Config.js is in config/addons

image

Config.js contents as follows:

/! 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.0.25',

    /**
     * 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: {
    '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;

dm82m commented 3 weeks ago

Put the config.js into /homeassistant/addons/ and restart the addon and post the logs of it

rblumenthal678 commented 3 weeks ago

OK, thanks. The addon seems to be working now. Logs as follows (and yes, I am using the correct password - which was changed from the default "vbus"). All the entities now show up, however they are shown as "not provided".

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.7 nodejs version: v22.7.0 npm version: 10.8.2 --- 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: Error: Remote side responded with "-ERROR: Password rejected" at onLine (/bin/resol-vbus/src/tcp-connection.js:271:35) at Socket.onSocketData (/bin/resol-vbus/src/tcp-connection.js:328:33) at Socket.emit (node:events:520:28) at addChunk (node:internal/streams/readable:559:12) at readableAddChunkPushByteMode (node:internal/streams/readable:510:3) at Readable.push (node:internal/streams/readable:390:5) at TCP.onStreamRead (node:internal/stream_base_commons:191:23)

dm82m commented 3 weeks ago

You can ask for help here: https://github.com/danielwippermann/resol-vbus/issues

dm82m commented 3 weeks ago

Question to Daniel: https://github.com/danielwippermann/resol-vbus/issues/105

dm82m commented 3 weeks ago

@rblumenthal678 follow my advice here: https://github.com/danielwippermann/resol-vbus/issues/105#issuecomment-2314561546

if you have more questions, lets continue here, as it has nothing todo with the json-live-data-server or the resol-vbus addon. both are not needed for you, as you are having a DL2 device!

rblumenthal678 commented 3 weeks ago

Thanks. Seems to have resolvedthe issu as I can now read the sensor data. Very nice integration. Thanks for the help.

Suggest that the documentation be updated as it states under the title KM1, VBus/LAN and VBUS/USB: "There is one prerequsite before it works. You need to run teh resol-vbus json-live-data-server. ...." This is confusing and led me down a wrong path.

dm82m commented 3 weeks ago

Yes in case that you use a KM1 or vbus/lan or vbus/usb this prerequisite is true. But if you read the documentation carefully it also states that in case of KM2 it just works out of the box ;-)

so it’s not a failure in the docs, they were just not read carefully 😅