Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ThermostatSetPoint not working as expected #11

Closed
duiffie opened this issue Nov 28, 2016 · 4 comments
Closed

ThermostatSetPoint not working as expected #11

duiffie opened this issue Nov 28, 2016 · 4 comments

Comments

@duiffie
Copy link
Contributor

duiffie commented Nov 28, 2016

When setting a Thermostat SetPoint (HRT4-ZW) via the set topic in MQTT, the result in the z-way-server log is:

[2016-11-28 09:00:58.277] [I] [core] --- ZWayVDev_zway_6-0-67-1 performCommand processing: {"0":"20.5"}
[2016-11-28 09:00:58.281] [I] [zway] Job 0x13 (SwitchMultilevel Set): Delivered
[2016-11-28 09:00:58.282] [I] [core] Notification: error (module): Error during perform command execution: TypeError: Cannot read property 'level' of undefined
[2016-11-28 09:00:58.282] [I] [zway] Removing job: SwitchMultilevel Set
[2016-11-28 09:00:58.313] [I] [core] TypeError: Cannot read property 'level' of undefined
at t_vDev.(anonymous function).self.controller.devices.create.handler (automation/modules/ZWave/index.js:3040:52)
at .extend.performCommand (automation/classes/VirtualDevice.js:291:37)
at automation/userModules/MQTT/index.js:94:15
at automation/userModules/MQTT/index.js:144:6
at Function.
.each..forEach (automation/lib/underscore.js:146:17)
at MQTT.processPublicationsForDevice (automation/userModules/MQTT/index.js:140:4)
at automation/userModules/MQTT/index.js:75:10
at Function.
.each._.forEach (automation/lib/underscore.js:146:17)
at _.extend.each (automation/classes/DevicesCollection.js:181:18)
at Object.zway/# (automation/userModules/MQTT/index.js:74:28)

it looks like it tries to set the thermostat as a SwitchMultilevel, which won't work.

My z-way version is v2.2.5

@pastukhov
Copy link
Contributor

same with 2.2.4 and heatit thermostat.

@duiffie
Copy link
Contributor Author

duiffie commented Dec 8, 2016

Fixed this for now on my machine by editing index.js of the MQTT module, and adding 2 lines of code starting on line 93:

      if (deviceType === "switchMultilevel" && payload !== "on" && payload !== "off") {
             self.log();
             device.performCommand("exact", {level: payload + "%"});
+     } else if (deviceType === "thermostat") {
+            device.performCommand("exact", {level: payload});
      } else {
             device.performCommand(payload);
      }

@Edubits
Copy link
Owner

Edubits commented Dec 8, 2016

That's great @duiffie, would you mind doing a PR for this? Than it's clearly your contribution 👍
I'll test it in the weekend.

Edubits added a commit that referenced this issue Dec 11, 2016
Fixes #11: adds thermostat setpoint (set) support
@akoenecke
Copy link

To made the Thermostat Setpoint "Device" selectable in the MQTT-Configuration I had to add "namespaces:devices_thermostat:deviceName" in /options/fields/publications/items/deviceId/optionLabels and "namespaces:devices_thermostat:deviceId" in /schema/properties/publications/deviceId/enum in module.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants