diff --git a/.github/workflows/automerge.yml b/.github/workflows/automerge.yml index f2ecf8f4..c0494c79 100644 --- a/.github/workflows/automerge.yml +++ b/.github/workflows/automerge.yml @@ -22,6 +22,6 @@ jobs: runs-on: ubuntu-latest steps: - name: automerge - uses: 'pascalgn/automerge-action@v0.11.0' + uses: 'pascalgn/automerge-action@v0.12.0' env: GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}' diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5d6f19df..690a25b9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,7 +26,7 @@ jobs: path: open-zwave - name: Cache openzwave - uses: actions/cache@v1 + uses: actions/cache@v2.1.2 with: path: open-zwave key: ${{ hashFiles('open-zwave/.git/refs/heads/master') }} @@ -48,7 +48,7 @@ jobs: - name: Cache node modules id: cache-node-modules - uses: actions/cache@v1 + uses: actions/cache@v2.1.2 with: path: node_modules key: ${{ matrix['node-version'] }}-npm-${{ hashFiles('package-lock.json') }} @@ -63,7 +63,7 @@ jobs: - name: Cache build id: cache-build - uses: actions/cache@v1 + uses: actions/cache@v2.1.2 with: path: dist key: ${{ matrix['node-version'] }}-cache-build-${{ hashFiles('build/*') }}-${{ hashFiles('src/*') }}-${{ hashFiles('static/*') }}-${{ hashFiles('package-lock.json') }} diff --git a/.github/workflows/dockerbuild.yml b/.github/workflows/dockerbuild.yml index 71748cf4..15a47b5d 100644 --- a/.github/workflows/dockerbuild.yml +++ b/.github/workflows/dockerbuild.yml @@ -25,26 +25,27 @@ jobs: password: ${{ secrets.DOCKER_PASSWORD }} - name: Prepare + id: prepare run: | DOCKER_REPO=robertslando/zwave2mqtt + TAGS=${DOCKER_REPO}:sha-${GITHUB_SHA} + if [ "$GITHUB_REF" == "refs/heads/master" ]; then - TAGS="${DOCKER_REPO}:dev\n" + TAGS=$TAGS,${DOCKER_REPO}:dev fi if [ "$GITHUB_EVENT_NAME" == "release" ]; then - TAGS="${TAGS}${DOCKER_REPO}:latest\n" - TAGS="${TAGS}${DOCKER_REPO}:$(echo ${GITHUB_REF} | sed "s/refs\/tags\/v//")\n" + TAGS=$TAGS,${DOCKER_REPO}:latest + TAGS=$TAGS,${DOCKER_REPO}:$(echo ${GITHUB_REF} | sed "s/refs\/tags\/v//") >> ./TAGS fi - TAGS="${TAGS}${DOCKER_REPO}:sha-${GITHUB_SHA}" - - echo TAGS="${TAGS}" >> $GITHUB_ENV + echo ::set-output name=TAGS::${TAGS} echo DOCKER_REPO="${DOCKER_REPO}" >> $GITHUB_ENV - name: build+push uses: docker/build-push-action@v2 with: cache-from: type=registry,ref=${{ env.DOCKER_REPO }}:sha-${{ env.GITHUB_SHA }} - platforms: linux/arm64,linux/amd64,linux/arm/v6,linux/arm/v7,linux/386 + platforms: linux/arm64,linux/amd64,linux/arm/v6,linux/arm/v7 file: docker/Dockerfile push: ${{ github.event_name != 'pull_request' }} - tags: ${{ env.TAGS }} + tags: ${{ steps.prepare.outputs.TAGS }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 46132b68..f76e6710 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,37 @@ All notable changes to this project will be documented in this file. Dates are d Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). +#### [v4.0.5](https://github.com/OpenZWave/Zwave2Mqtt/compare/v4.0.4...v4.0.5) + +> 16 October 2020 + +- chore: audit fix high severity [`#794`](https://github.com/OpenZWave/Zwave2Mqtt/pull/794) +- fix: Rows per page not set correctly [`#793`](https://github.com/OpenZWave/Zwave2Mqtt/pull/793) +- feat: support more ENV VARS for configuration [`#788`](https://github.com/OpenZWave/Zwave2Mqtt/pull/788) +- fix: typo in comment [`#789`](https://github.com/OpenZWave/Zwave2Mqtt/pull/789) +- docs: libudev.h shouldn't be required with ozw 1.6 [`#786`](https://github.com/OpenZWave/Zwave2Mqtt/pull/786) +- feat: improve HASS discovery of cover devices [`#783`](https://github.com/OpenZWave/Zwave2Mqtt/pull/783) +- chore(deps): bump actions/cache from v1 to v2.1.2 [`#780`](https://github.com/OpenZWave/Zwave2Mqtt/pull/780) +- feat(hass): adding CT100 using 2GIG template [`#776`](https://github.com/OpenZWave/Zwave2Mqtt/pull/776) +- chore(ci): remove linux/386 to fix dockerbuild [`#782`](https://github.com/OpenZWave/Zwave2Mqtt/pull/782) +- Update README.md [`#774`](https://github.com/OpenZWave/Zwave2Mqtt/pull/774) +- tidy up the docker build [`#769`](https://github.com/OpenZWave/Zwave2Mqtt/pull/769) +- dependabot update github actions and docker [`#766`](https://github.com/OpenZWave/Zwave2Mqtt/pull/766) +- close stale issues+prs [`#756`](https://github.com/OpenZWave/Zwave2Mqtt/pull/756) +- Create Dependabot config file [`#566`](https://github.com/OpenZWave/Zwave2Mqtt/pull/566) +- docker: update ozw to 1.6.392 [`#751`](https://github.com/OpenZWave/Zwave2Mqtt/pull/751) +- docker: update ozw to version 1.6.1382 [`#748`](https://github.com/OpenZWave/Zwave2Mqtt/pull/748) +- feat(hass): Eurotronic Stella Z thermostat [`#746`](https://github.com/OpenZWave/Zwave2Mqtt/pull/746) +- fix: Rows per page not set correctly (#793) [`#792`](https://github.com/OpenZWave/Zwave2Mqtt/issues/792) +- fix tag list composition [`55e0dc0`](https://github.com/OpenZWave/Zwave2Mqtt/commit/55e0dc0b69bd212130305989793037c33e588383) +- fix tag list composition [`50cf1ad`](https://github.com/OpenZWave/Zwave2Mqtt/commit/50cf1add8ed6d52b90898c0fcd78cc9f90d5a63f) +- fix tag list composition [`0e95d46`](https://github.com/OpenZWave/Zwave2Mqtt/commit/0e95d46235559c735e142b908c6f55a14a5753b5) +- fix tag list composition [`cb1f337`](https://github.com/OpenZWave/Zwave2Mqtt/commit/cb1f337971daf151f2173fe1095f895291284f0a) +- fix tag list composition [`8221a56`](https://github.com/OpenZWave/Zwave2Mqtt/commit/8221a56c67839cbd262127e21ed78962efc2c91a) +- fix tag list composition [`0857c43`](https://github.com/OpenZWave/Zwave2Mqtt/commit/0857c43639340dee42f203e27fe205d5599c5f0f) +- fix tag list composition [`970b82a`](https://github.com/OpenZWave/Zwave2Mqtt/commit/970b82acb50c1eba93a7b7c79ab524a503774fa6) +- fix tag list composition [`5569669`](https://github.com/OpenZWave/Zwave2Mqtt/commit/55696698bc8bc5e930180aa2dfa005ece8d0116b) + #### [v4.0.4](https://github.com/OpenZWave/Zwave2Mqtt/compare/v4.0.3...v4.0.4) > 28 September 2020 @@ -22,6 +53,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - chore(deps): upgrade vuetify from 2.3.4 to 2.3.5 [`#667`](https://github.com/OpenZWave/Zwave2Mqtt/pull/667) - chore(deps): upgrade serialport from 9.0.0 to 9.0.1 [`#695`](https://github.com/OpenZWave/Zwave2Mqtt/pull/695) - docs: fix anchor link in README [`#696`](https://github.com/OpenZWave/Zwave2Mqtt/pull/696) +- Release 4.0.4 [`2c5f939`](https://github.com/OpenZWave/Zwave2Mqtt/commit/2c5f939fd8bbaba5d6b66315cffa5118c90e8b70) #### [v4.0.3](https://github.com/OpenZWave/Zwave2Mqtt/compare/v4.0.2...v4.0.3) diff --git a/README.md b/README.md index 74ac42f5..1bc0e21e 100644 --- a/README.md +++ b/README.md @@ -82,6 +82,7 @@ After a [discussion](https://github.com/OpenZWave/Zwave2Mqtt/issues/201) with Op - [Mesh](#mesh) - [Debug](#debug) - [Health check endpoints](#health-check-endpoints) + - [Environment variables](#environment-variables) - [:question: FAQ](#-faq) - [:pray: Thanks](#-thanks) - [:pencil: TODOs](#-todos) @@ -111,19 +112,16 @@ For more info about docker check [here](docker/README.md) ### Kubernetes way ```bash -kubectl apply -k https://raw.githubusercontent.com/openzwave/zwave2mqtt/master/kustomize.yml +kubectl apply -k https://raw.githubusercontent.com/OpenZWave/Zwave2Mqtt/master/kustomization.yaml ``` > You will almost certainly need to instead use this as a base, and then layer on top patches or resource customizations to your needs or just copy all the resources from the [kubernetes resources](./kubernetes) directory of this repo ### NodeJS or PKG version -1. Firstly you need to install [Open-Zwave](https://github.com/OpenZWave/open-zwave) library on your system. - - If you are using Ubuntu: +1. Firstly you need to install the [Open-Zwave](https://github.com/OpenZWave/open-zwave) library on your system. ```sh - sudo apt-get install libudev-dev git cd ~ git clone https://github.com/OpenZWave/open-zwave.git cd open-zwave && make && sudo make install @@ -807,6 +805,17 @@ Remember to add the header: `Accept: text/plain` to your request. Example: `curl localhost:8091/health/zwave -H "Accept: text/plain"` +## Environment variables + +_**Note**: Each one of the following environment variables corresponds to their respective options in the UI settings and options saved in the UI take presence over these environment variables._ + +- `OZW_NETWORK_KEY` +- `OZW_SAVE_CONFIG` +- `OZW_POLL_INTERVAL` +- `OZW_AUTO_UPDATE_CONFIG` +- `OZW_CONFIG_PATH` +- `OZW_ASSUME_AWAKE` + ## :question: FAQ > A: Why when I add a value to Gateway values table I don't see all my devices? diff --git a/hass/configurations.js b/hass/configurations.js index 73c9339f..e0b0e31a 100755 --- a/hass/configurations.js +++ b/hass/configurations.js @@ -226,14 +226,17 @@ module.exports = { }, cover_position: { type: 'cover', - object_id: 'cover', + object_id: 'position', discovery_payload: { + state_topic: true, command_topic: true, position_topic: true, set_position_topic: true, - set_position_template: '{ "value": {{ position }} }', - value_template: '{{ value_json.value }}', - state_topic: false + value_template: '{{ value_json.value | round(0) }}', + position_open: 99, + position_closed: 0, + payload_open: '99', + payload_close: '0' } }, diff --git a/hass/devices.js b/hass/devices.js index b0aeff26..f7b465d8 100644 --- a/hass/devices.js +++ b/hass/devices.js @@ -22,7 +22,7 @@ const FAN_DIMMER = { } } -// Radio Thermostat / 2GIG CT32 and CT101 +// Radio Thermostat / 2GIG CT32, CT100 and CT101 const THERMOSTAT_2GIG = { type: 'climate', object_id: 'thermostat', @@ -337,12 +337,14 @@ module.exports = { '99-12340-18756': [FAN_DIMMER], // GE 1724 Dimmer '99-12593-18756': [FAN_DIMMER], // GE 1724 Dimmer '152-12-25857': [THERMOSTAT_2GIG], // Radio Thermostat / 2GIG CT101 + '152-263-25601': [THERMOSTAT_2GIG], // Radio Thermostat / 2GIG CT100 '152-256-8194': [THERMOSTAT_2GIG], // Radio Thermostat / 2GIG CT32 '271-4096-770': [COVER], // Fibaro FGS222 '328-1-1': [STELLA_ZWAVE], '328-1-3': [SPIRIT_ZWAVE_PLUS], '328-2-3': [SPIRIT_ZWAVE_PLUS], '328-3-3': [SPIRIT_ZWAVE_PLUS], - '345-82-3': [COVER], // Qubin0 flush shutter - '622-23089-17235': [COVER] // Graber/Bali/Spring Fashion Covers + '345-82-3': [COVER], // Qubino flush shutter + '622-23089-17235': [COVER], // Graber/Bali/Spring Fashion Covers + '881-21-2': [SPIRIT_ZWAVE_PLUS] // Eurotronic Spirit / Aeotec ZWA021 } diff --git a/lib/Constants.js b/lib/Constants.js index 0fdb57d0..ec44c1b6 100644 --- a/lib/Constants.js +++ b/lib/Constants.js @@ -370,5 +370,253 @@ module.exports = { }, commandClass (cmd) { return this._commandClassMap[cmd] || 'unknownClass_' + cmd + }, + _genericDeviceClassMap: { + // https://github.com/OpenZWave/open-zwave/blob/master/config/device_classes.xml + // https://github.com/home-assistant/core/blob/dev/homeassistant/components/zwave/const.py#L196 + // 0x00: specific_type_not_used // Available in all Generic types + 0x01: { + generic: 'generic_type_generic_controller', + specific: { + 0x01: 'specific_type_portable_controller', + 0x02: 'specific_type_portable_scene_controller', + 0x03: 'specific_type_portable_installer_tool', + 0x04: 'specific_type_control_av', + 0x06: 'specific_type_control_simple' + } + }, + 0x02: { + generic: 'generic_type_static_controller', + specific: { + 0x01: 'specific_type_pc_controller', + 0x02: 'specific_type_scene_controller', + 0x03: 'specific_type_static_installer_tool', + 0x04: 'specific_type_set_top_box', + 0x05: 'specific_type_sub_system_controller', + 0x06: 'specific_type_tv', + 0x07: 'specific_type_gateway' + } + }, + 0x03: { + generic: 'generic_type_av_control_point', + specific: { + 0x01: 'specific_type_sound_switch', + 0x04: 'specific_type_satellite_receiver', + 0x11: 'specific_type_satellite_receiver_v2', + 0x12: 'specific_type_doorbell' + } + }, + 0x04: { + generic: 'generic_type_display', + specific: { + 0x01: 'specific_type_simple_display' + } + }, + 0x05: { + generic: 'generic_type_network_extender', + specific: { + 0x01: 'specific_type_secure_extender' + } + }, + 0x06: { + generic: 'generic_type_appliance', + specific: { + 0x01: 'specific_type_general_appliance', + 0x02: 'specific_type_kitchen_appliance', + 0x03: 'specific_type_laundry_appliance' + } + }, + 0x07: { + generic: 'generic_type_sensor_notification', + specific: { + 0x01: 'specific_type_notification_sensor' + } + }, + 0x08: { + generic: 'generic_type_thermostat', + specific: { + 0x01: 'specific_type_thermostat_heating', + 0x02: 'specific_type_thermostat_general', + 0x03: 'specific_type_setback_schedule_thermostat', + 0x04: 'specific_type_setpoint_thermostat', + 0x05: 'specific_type_setback_thermostat', + 0x06: 'specific_type_thermostat_general_v2' + } + }, + 0x09: { + generic: 'generic_type_windows_covering', + specific: { + 0x01: 'specific_type_simple_window_covering' + } + }, + 0x0f: { + generic: 'generic_type_repeater_slave', + specific: { + 0x01: 'specific_type_repeater_slave', + 0x02: 'specific_type_virtual_node' + } + }, + 0x10: { + generic: 'generic_type_switch_binary', + specific: { + 0x01: 'specific_type_power_switch_binary', + 0x02: 'specific_type_color_tunable_binary', + 0x03: 'specific_type_scene_switch_binary', + 0x04: 'specific_type_power_strip', + 0x05: 'specific_type_siren', + 0x06: 'specific_type_valve_open_close', + 0x07: 'specific_type_irrigation_controller' + } + }, + 0x11: { + generic: 'generic_type_switch_multilevel', + specific: { + 0x01: 'specific_type_power_switch_multilevel', + 0x02: 'specific_type_color_tunable_multilevel', + 0x03: 'specific_type_motor_multiposition', + 0x04: 'specific_type_scene_switch_multilevel', + 0x05: 'specific_type_class_a_motor_control', + 0x06: 'specific_type_class_b_motor_control', + 0x07: 'specific_type_class_c_motor_control', + 0x08: 'specific_type_fan_switch' + } + }, + 0x12: { + generic: 'generic_type_switch_remote', + specific: { + 0x01: 'specific_type_remote_binary', + 0x02: 'specific_type_remote_multilevel', + 0x03: 'specific_type_remove_toggle_binary', + 0x04: 'specific_type_remote_toggle_multilevel' + } + }, + 0x13: { + generic: 'generic_type_switch_toggle', + specific: { + 0x01: 'specific_type_switch_toggle_binary', + 0x02: 'specific_type_switch_toggle_multilevel' + } + }, + 0x14: { + generic: 'generic_type_zip_gateway', + specific: { + 0x01: 'specific_type_zip_tun_gateway', + 0x02: 'specific_type_zip_adv_gateway' + } + }, + 0x15: { + generic: 'generic_type_zip_node', + specific: { + 0x01: 'specific_type_zip_tun_node', + 0x02: 'specific_type_zip_adv_node' + } + }, + 0x16: { + generic: 'generic_type_ventilation', + specific: { + 0x01: 'specific_type_residential_hrv' + } + }, + 0x17: { + generic: 'generic_type_security_panel', + specific: { + 0x01: 'specific_type_zoned_security_panel' + } + }, + 0x18: { + generic: 'generic_type_wall_controller', + specific: { + 0x01: 'specific_type_basic_wall_controller' + } + }, + 0x20: { + generic: 'generic_type_sensor_binary', + specific: { + 0x01: 'specific_type_routing_sensor_binary' + } + }, + 0x21: { + generic: 'generic_type_sensor_multilevel', + specific: { + 0x01: 'specific_type_routing_sensor_multilevel', + 0x02: 'specific_type_chimney_fan' + } + }, + 0x30: { + generic: 'generic_type_meter_pulse', + specific: {} + }, + 0x31: { + generic: 'generic_type_meter', + specific: { + 0x01: 'specific_type_simple_meter', + 0x02: 'specific_type_adv_energy_control', + 0x03: 'specific_type_whole_home_meter_simple' + } + }, + 0x40: { + generic: 'generic_type_entry_control', + specific: { + 0x01: 'specific_type_door_lock', + 0x02: 'specific_type_advanced_door_lock', + 0x03: 'specific_type_secure_keypad_door_lock', + 0x04: 'specific_type_secure_keypad_door_lock_deadbolt', + 0x05: 'specific_type_secure_door', + 0x06: 'specific_type_secure_gate', + 0x07: 'specific_type_secure_barrier_addon', + 0x08: 'specific_type_secure_barrier_open_only', + 0x09: 'specific_type_secure_barrier_close_only', + 0x0a: 'specific_type_secure_lockbox', + 0x0b: 'specific_type_secure_keypad' + } + }, + 0x50: { + generic: 'generic_type_semi_interoperable', + specific: { + 0x01: 'specific_type_energy_production' + } + }, + 0xa1: { + generic: 'generic_type_sensor_alarm', + specific: { + 0x01: 'specific_type_basic_routing_alarm_sensor', + 0x02: 'specific_type_routing_alarm_sensor', + 0x03: 'specific_type_basic_zensor_net_alarm_sensor', + 0x04: 'specific_type_zensor_net_alarm_sensor', + 0x05: 'specific_type_adv_zensor_net_alarm_sensor', + 0x06: 'specific_type_basic_routing_smoke_sensor', + 0x07: 'specific_type_routing_smoke_sensor', + 0x08: 'specific_type_basic_zensor_net_smoke_sensor', + 0x09: 'specific_type_zensor_net_smoke_sensor', + 0x0a: 'specific_type_adv_zensor_net_smoke_sensor', + 0x0b: 'specific_type_alarm_sensor' + } + }, + 0xff: { + generic: 'generic_type_non_interoperable', + specific: {} + } + }, + genericDeviceClassAttributes (cls) { + return this._genericDeviceClassMap[cls] + }, + genericDeviceClass (cls) { + var clsAttr = this.genericDeviceClassAttributes(cls) + if (clsAttr) { + return clsAttr.generic + } else { + return 'unknownGenericDeviceType_' + cls + } + }, + specificDeviceClass (genericCls, specificCls) { + var clsAttr = this.genericDeviceClassAttributes(genericCls) + if (clsAttr) { + return ( + clsAttr.specific[specificCls] || + 'unknownSpecificDeviceType_' + specificCls + ) + } else { + return 'unknownGenericDeviceType_' + genericCls + } } } diff --git a/lib/Gateway.js b/lib/Gateway.js index 303667b3..d30ba699 100755 --- a/lib/Gateway.js +++ b/lib/Gateway.js @@ -1095,28 +1095,52 @@ Gateway.prototype.discoverValue = function (node, valueId) { break case 'switch_multilevel': case 'switch_toggle_multilevel': - // cfg = copy(hassCfg.cover_position) - // cfg.discovery_payload.position_open = valueId.max || 100 - // cfg.discovery_payload.position_closed = valueId.min || 0 - // cfg.discovery_payload.position_topic = this.mqtt.getTopic(topic) - // cfg.discovery_payload.set_position_topic = cfg.discovery_payload.position_topic + '/set' if (valueId.index === 0) { - // brightness level - const rgb = node.values['51-1-0'] - if (rgb) { - cfg = copy(hassCfg.light_rgb_dimmer) - cfg.discovery_payload.rgb_state_topic = this.mqtt.getTopic( - this.valueTopic(node, rgb) - ) - cfg.discovery_payload.rgb_command_topic = - cfg.discovery_payload.rgb_state_topic + '/set' - cfg.discovery_payload.brightness_state_topic = this.mqtt.getTopic( - topic - ) - cfg.discovery_payload.brightness_command_topic = - cfg.discovery_payload.brightness_state_topic + '/set' + var specificDeviceClass = Constants.specificDeviceClass( + node.generic_device_class, + node.specific_device_class + ) + // Use a cover_position configuration if ... + if ( + [ + 'specific_type_class_a_motor_control', + 'specific_type_class_b_motor_control', + 'specific_type_class_c_motor_control', + 'specific_type_class_motor_multiposition' + ].includes(specificDeviceClass) + ) { + cfg = copy(hassCfg.cover_position) + cfg.discovery_payload.state_topic = this.mqtt.getTopic(topic) + cfg.discovery_payload.command_topic = + cfg.discovery_payload.state_topic + '/set' + cfg.discovery_payload.position_topic = this.mqtt.getTopic(topic) + cfg.discovery_payload.set_position_topic = + cfg.discovery_payload.position_topic + '/set' + cfg.discovery_payload.value_template = + '{{ value_json.value | round(0) }}' + cfg.discovery_payload.position_open = 99 + cfg.discovery_payload.position_closed = 0 + cfg.discovery_payload.payload_open = 99 + cfg.discovery_payload.payload_close = 0 } else { - cfg = copy(hassCfg.light_dimmer) + // ... otherwise use a light dimmer configuration + // brightness level + const rgb = node.values['51-1-0'] + if (rgb) { + cfg = copy(hassCfg.light_rgb_dimmer) + cfg.discovery_payload.rgb_state_topic = this.mqtt.getTopic( + this.valueTopic(node, rgb) + ) + cfg.discovery_payload.rgb_command_topic = + cfg.discovery_payload.rgb_state_topic + '/set' + cfg.discovery_payload.brightness_state_topic = this.mqtt.getTopic( + topic + ) + cfg.discovery_payload.brightness_command_topic = + cfg.discovery_payload.brightness_state_topic + '/set' + } else { + cfg = copy(hassCfg.light_dimmer) + } } } else return break diff --git a/lib/ZwaveClient.js b/lib/ZwaveClient.js index 3e9da64e..93513179 100644 --- a/lib/ZwaveClient.js +++ b/lib/ZwaveClient.js @@ -136,6 +136,10 @@ async function init (cfg, socket) { this.closed = false this.scenes = jsonStore.get(store.scenes) + cfg.saveConfig = cfg.saveConfig || process.env.OZW_SAVE_CONFIG + cfg.autoUpdateConfig = + cfg.autoUpdateConfig || process.env.OZW_AUTO_UPDATE_CONFIG + // Full option list: https://github.com/OpenZWave/open-zwave/wiki/Config-Options var options = { Logging: cfg.logging, @@ -146,7 +150,7 @@ async function init (cfg, socket) { SaveConfiguration: Boolean(cfg.saveConfig), // RetryTimeout: 10000, // IntervalBetweenPolls: true, - PollInterval: cfg.pollInterval, + PollInterval: cfg.pollInterval || process.env.OZW_POLL_INTERVAL, AutoUpdateConfigFile: Boolean(cfg.autoUpdateConfig) // SuppressValueRefresh: true, } @@ -158,11 +162,11 @@ async function init (cfg, socket) { } if (cfg.configPath) { - options.ConfigPath = cfg.configPath + options.ConfigPath = cfg.configPath || process.env.OZW_CONFIG_PATH } if (cfg.assumeAwake) { - options.AssumeAwake = cfg.assumeAwake + options.AssumeAwake = cfg.assumeAwake || process.env.OZW_ASSUME_AWAKE } if (cfg.options) { @@ -517,6 +521,8 @@ function valueChanged (nodeid, comclass, valueId) { } // update cache ozwnode.values[value_id] = valueId + // update last active timestamp + ozwnode.lastActive = Date.now() } // check if node is added as secure node @@ -906,6 +912,10 @@ ZwaveClient.prototype.initNode = function (ozwnode, nodeinfo) { var deviceID = getDeviceID(ozwnode) ozwnode.device_id = deviceID + ozwnode.basic_device_class = this.client.getNodeBasic(nodeid) + ozwnode.generic_device_class = this.client.getNodeGeneric(nodeid) + ozwnode.specific_device_class = this.client.getNodeSpecific(nodeid) + // if scan is complete update node groups (for nodes added 'on fly') if (this.scanComplete) { this.getGroups(nodeid) diff --git a/package-lock.json b/package-lock.json index 951d9374..2d791242 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "zwave2mqtt", - "version": "4.0.4", + "version": "4.0.5", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -13975,9 +13975,9 @@ "dev": true }, "node-forge": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-0.9.0.tgz", - "integrity": "sha512-7ASaDa3pD+lJ3WvXFsxekJQelBKRpne+GOVbLbtHYdd7pFspyeuJHnWfLplGf3SwKGbfs/aYl5V/JCIaHVUKKQ==", + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-0.10.0.tgz", + "integrity": "sha512-PPmu8eEeG9saEUvI97fm4OYxXVB6bFvyNTyiUOBichBpFG8A1Ljw3bY62+5oOjDEMHRnd0Y7HQ+x7uzxOzC6JA==", "dev": true }, "node-libs-browser": { @@ -18613,12 +18613,12 @@ "dev": true }, "selfsigned": { - "version": "1.10.7", - "resolved": "https://registry.npmjs.org/selfsigned/-/selfsigned-1.10.7.tgz", - "integrity": "sha512-8M3wBCzeWIJnQfl43IKwOmC4H/RAp50S8DF60znzjW5GVqTcSe2vWclt7hmYVPkKPlHWOu5EaWOMZ2Y6W8ZXTA==", + "version": "1.10.8", + "resolved": "https://registry.npmjs.org/selfsigned/-/selfsigned-1.10.8.tgz", + "integrity": "sha512-2P4PtieJeEwVgTU9QEcwIRDQ/mXJLX8/+I3ur+Pg16nS8oNbrGxEso9NyYWy8NAmXiNl4dlAp5MwoNeCWzON4w==", "dev": true, "requires": { - "node-forge": "0.9.0" + "node-forge": "^0.10.0" } }, "semver": { diff --git a/package.json b/package.json index 517c16ba..ab2eac25 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "zwave2mqtt", - "version": "4.0.4", + "version": "4.0.5", "bin": "bin/www", "description": "Zwave To MQTT Gateway", "author": "Daniel Lando ", diff --git a/src/App.vue b/src/App.vue index 87a9c449..5a8b34e5 100644 --- a/src/App.vue +++ b/src/App.vue @@ -83,7 +83,7 @@ v-model="snackbar" > {{ snackbarText }} - Close + Close diff --git a/src/components/Confirm.vue b/src/components/Confirm.vue index fe0094b7..92106bc7 100644 --- a/src/components/Confirm.vue +++ b/src/components/Confirm.vue @@ -12,8 +12,8 @@ {{ message }} - Yes - Cancel + Yes + Cancel diff --git a/src/components/ControlPanel.vue b/src/components/ControlPanel.vue index a9b7d3c3..427bd71e 100644 --- a/src/components/ControlPanel.vue +++ b/src/components/ControlPanel.vue @@ -47,7 +47,7 @@ - +