Skip to content

Commit

Permalink
update to support Protocol Version 3.33
Browse files Browse the repository at this point in the history
  • Loading branch information
DutchmanNL committed Aug 7, 2023
1 parent c2960e1 commit e5b3528
Show file tree
Hide file tree
Showing 11 changed files with 173 additions and 11 deletions.
2 changes: 1 addition & 1 deletion lib/AlarmReasons.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// VE.Direct Protocol Version 3.26 from 27 November 2018
// VE.Direct Protocol Version 3.33 from 6 June 2023
// All available Alarm Reasons
const AlarmReasons = {
'0': {
Expand Down
2 changes: 1 addition & 1 deletion lib/BleReasons.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// VE.Direct Protocol Version 3.26 from 27 November 2018
// VE.Direct Protocol Version 3.33 from 6 June 2023
// All available BLE Off Reasons
const BleReasons = {
'0x00000001': {
Expand Down
2 changes: 1 addition & 1 deletion lib/DeviceModes.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// VE.Direct Protocol Version 3.26 from 27 November 2018
// VE.Direct Protocol Version 3.33 from 6 June 2023
// All available Device Modes
const DeviceModes = {
'1': {
Expand Down
2 changes: 1 addition & 1 deletion lib/ErrorNames.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// VE.Direct Protocol Version 3.26 from 27 November 2018
// VE.Direct Protocol Version 3.33 from 6 June 2023
// All available errors
const ErrorNames = {
'0': {
Expand Down
2 changes: 1 addition & 1 deletion lib/MonitorTypes.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// VE.Direct Protocol Version 3.32 from 30 June 2021
// VE.Direct Protocol Version 3.33 from 6 June 2023
// All available Monitor Types
const MonitorTypes = {
'-9': {
Expand Down
2 changes: 1 addition & 1 deletion lib/MpptModes.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// VE.Direct Protocol Version 3.26 from 27 November 2018
// VE.Direct Protocol Version 3.33 from 6 June 2023
// All available MPPT Modes
const MpptModes = {
'0': {
Expand Down
2 changes: 1 addition & 1 deletion lib/OffReasons.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// VE.Direct Protocol Version 3.26 from 27 November 2018
// VE.Direct Protocol Version 3.33 from 6 June 2023
// All available Off Reasons
const OffReasons = {
'0x00000000': {
Expand Down
2 changes: 1 addition & 1 deletion lib/OperationStates.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// VE.Direct Protocol Version 3.26 from 27 November 2018
// VE.Direct Protocol Version 3.33 from 6 June 2023
// All available Operation States
const OperationStates = {
'0': {
Expand Down
129 changes: 129 additions & 0 deletions lib/ProductNames.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,84 @@ const ProductNames = {
'0xA065': {
'pid':'SmartSolar MPPT 250|100 rev2'
},
'0xA066': {
'pid':'BlueSolar MPPT 100|20'
},
'0xA067': {
'pid':'BlueSolar MPPT 100|20 48V'
},
'0xA068': {
'pid':'SmartSolar MPPT 250|60 rev2'
},
'0xA069': {
'pid':'SmartSolar MPPT 250|70 rev2'
},
'0xA06A': {
'pid':'SmartSolar MPPT 150|45 rev2'
},
'0xA06B': {
'pid':'SmartSolar MPPT 150|60 rev2'
},
'0xA06C': {
'pid':'SmartSolar MPPT 150|70 rev2'
},
'0xA06D': {
'pid':'SmartSolar MPPT 150|85 rev3'
},
'0xA06E': {
'pid':'SmartSolar MPPT 150|100 rev3'
},
'0xA06F': {
'pid':'BlueSolar MPPT 150|45 rev2'
},
'0xA070': {
'pid':'BlueSolar MPPT 150|60 rev2'
},
'0xA071': {
'pid':'BlueSolar MPPT 150|70 rev2'
},
'0xA072': {
'pid':'BlueSolar MPPT 150/45 rev3'
},
'0xA073': {
'pid':'SmartSolar MPPT 150/45 rev3'
},
'0xA074': {
'pid':'SmartSolar MPPT 75/10 rev2'
},
'0xA075': {
'pid':'SmartSolar MPPT 75/15 rev2'
},
'0xA076': {
'pid':'BlueSolar MPPT 100/30 rev3'
},
'0xA077': {
'pid':'BlueSolar MPPT 100/50 rev3'
},
'0xA078': {
'pid':'BlueSolar MPPT 150/35 rev3'
},
'0xA079': {
'pid':'BlueSolar MPPT 75/10 rev2'
},
'0xA07A': {
'pid':'BlueSolar MPPT 75/15 rev2'
},
'0xA07B': {
'pid':'BlueSolar MPPT 100/15 rev2'
},
'0xA07C': {
'pid':'BlueSolar MPPT 75/10 rev3'
},
'0xA07D': {
'pid':'BlueSolar MPPT 75/15 rev3'
},
'0xA07E': {
'pid':'SmartSolar MPPT 100/30 12V'
},
'0xA07F': {
'pid':'All-In-1 SmartSolar MPPT 75/15 12V'
},
'0xA102': {
'pid':'SmartSolar MPPT VE.Can 150/70'
},
Expand Down Expand Up @@ -154,6 +232,36 @@ const ProductNames = {
'0xA10B': {
'pid':'SmartSolar MPPT VE.Can 250/100'
},
'0xA10C': {
'pid':'SmartSolar MPPT VE.Can 150/70 rev2'
},
'0xA10D': {
'pid':'SmartSolar MPPT VE.Can 150/85 rev2'
},
'0xA10E': {
'pid':'SmartSolar MPPT VE.Can 150/100 rev2'
},
'0xA10F': {
'pid':'BlueSolar MPPT VE.Can 150/100'
},
'0xA112': {
'pid':'BlueSolar MPPT VE.Can 250/70'
},
'0xA113': {
'pid':'BlueSolar MPPT VE.Can 250/100'
},
'0xA114': {
'pid':'SmartSolar MPPT VE.Can 250/70 rev2'
},
'0xA115': {
'pid':'SmartSolar MPPT VE.Can 250/100 rev2'
},
'0xA116': {
'pid':'SmartSolar MPPT VE.Can 250/85 rev2'
},
'0xA117': {
'pid':'BlueSolar MPPT VE.Can 150/100 rev2'
},
'0xA201': {
'pid':'Phoenix Inverter 12V 250VA 230V'
},
Expand Down Expand Up @@ -321,6 +429,27 @@ const ProductNames = {
},
'0xA347': {
'pid':'Phoenix Smart IP43 Charger 24|16 (3)'
},
'0xA381': {
'pid':'BMV-712 Smart'
},
'0xA382': {
'pid':'BMV-710H Smart'
},
'0xA383': {
'pid':'BMV-712 Smart Rev2'
},
'0xA389': {
'pid':'SmartShunt 500A/50mV'
},
'0xA38A': {
'pid':'SmartShunt 1000A/50mV'
},
'0xA38B': {
'pid':'SmartShunt 2000A/50mV'
},
'0xA3F0': {
'pid':'Smart BuckBoost 12V/12V-50A'
}
};
module.exports = ProductNames;
23 changes: 22 additions & 1 deletion lib/stateAttr.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// VE.Direct Protocol Version 3.32 from 30 June 2021
// VE.Direct Protocol Version 3.33 from 6 June 2023
// Classification of all state attributes possible
const state_attrb = {
'V' : {
Expand Down Expand Up @@ -422,5 +422,26 @@ const state_attrb = {
unit: '',
expire: false
},
'DC_IN_V' : {
name: 'DC Input voltage',
type: 'number',
role: 'value.voltage',
unit: 'V',
expire: true
},
'DC_IN_I' : {
name: 'DC Input current',
type: 'number',
role: 'value.current',
unit: 'A',
expire: true
},
'DC_IN_P' : {
name: 'DC Input power',
type: 'number',
role: 'value.power',
unit: 'W',
expire: true
},
}
module.exports = state_attrb;
16 changes: 14 additions & 2 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/*
* Created with @iobroker/create-adapter v1.16.0
VE.Direct Protocol Version 3.32 from 30. June 2021
VE.Direct Protocol Version 3.33 from 6. June 2023
*/

// The adapter-core module gives you access to the core ioBroker functions
Expand Down Expand Up @@ -48,7 +48,7 @@ class Vedirect extends utils.Adapter {
*/
async onReady() {
// Initialize your adapter here
this.log.info('Starting VE.Direct with Protocol Version 3.32 and configurable expiring state capability');
this.log.info('Starting VE.Direct with Protocol Version 3.33 and configurable expiring state capability');
this.setState('info.connection', false, true);

try {
Expand Down Expand Up @@ -240,7 +240,19 @@ class Vedirect extends utils.Adapter {
case 'MON':
this.stateSetCreate(res[0], res[0], await this.get_monitor_type(res[1]));
break;

case 'DC_IN_V':
this.stateSetCreate(res[0], res[0], Math.floor(res[1]) / 100);
break;

case 'DC_IN_I':
this.stateSetCreate(res[0], res[0], Math.floor(res[1]) / 10);
break;

case 'DC_IN_P':
this.stateSetCreate(res[0], res[0], Math.floor(res[1]));
break;

default: // Used for all other measure points with no required special handling
this.stateSetCreate(res[0], res[0], res[1]);
break;
Expand Down

0 comments on commit e5b3528

Please sign in to comment.