set termostat value in module

Discussions about Z-Way software and Z-Wave technology in general
Post Reply
kgm
Posts: 3
Joined: 12 Nov 2014 19:33

set termostat value in module

Post by kgm »

I'm trying to write module that scheldue thermostat, but it doesnt work

In index.js I have
var aDev = this.controller.devices.get(this.config.thermostat);
aDev.instances[0].ThermostatSetPoint.Set(1,6);

I also tried
this.controller.devices[9].instances[0].ThermostatSetPoint.Set(1,6);

What am I doing wrong? How set temperature in script?
Z-Way 1.7.2; Raspberry Pi B+
pofs
Posts: 688
Joined: 25 Mar 2011 19:03

Re: set termostat value in module

Post by pofs »

You're mixing two different API levels.

Accessing devices[x].instances[y].ThermostatSetPoint is applicable only to Z-Wave binding, which is exported into global object zway. Note that global zway object may change or disappear, so your module should be ready to handle that.

If you're going with this.controller.devices, it returns virtual device that can be operated with metrics. This is a higher level of abstraction.
pz1
Posts: 2053
Joined: 08 Apr 2012 13:44

Re: set termostat value in module

Post by pz1 »

pofs wrote: Note that global zway object may change or disappear
Does this mean that I can throw away the whole 1.7 Z-Way developers manual ?
Since 29-12-2016 I am no longer a moderator for this forum
pofs
Posts: 688
Joined: 25 Mar 2011 19:03

Re: set termostat value in module

Post by pofs »

pz1 wrote:
pofs wrote: Note that global zway object may change or disappear
Does this mean that I can throw away the whole 1.7 Z-Way developers manual ?
No, why? I mean it may be re-created/removed in 2.0 when you reconfigure/disable Z-Wave Binding module, so you should design your modules having that in mind and don't keep global references to the objects that may become invalid.
pz1
Posts: 2053
Joined: 08 Apr 2012 13:44

Re: set termostat value in module

Post by pz1 »

OK thanks, now (I think) I understand the context.
Since 29-12-2016 I am no longer a moderator for this forum
kgm
Posts: 3
Joined: 12 Nov 2014 19:33

Re: set termostat value in module

Post by kgm »

Thank for reply. Now I have in script

Code: Select all

var aDev = self.controller.devices.get(self.config.thermostat);
aDev.performCommand("exact", { level : 16 });
but it still doesn't work
in log file:
ZWayVDev_8:0:Thermostat:T performCommand processing: {"0":"exact","1":{"level":16}}
but nothing happens, temperature setpoint remains unchanged.
Z-Way 1.7.2; Raspberry Pi B+
kgm
Posts: 3
Joined: 12 Nov 2014 19:33

Re: set termostat value in module

Post by kgm »

It seems that metrics doesn't work with object thermostat neither on v1.7.2 nor 2.0.0rc17.
There is also some problem with widget, witch doesn't display at all.

This worked for me. Maybe someone find it usefull

Code: Select all

 
var setTemp = parseInt ( self.config.temperature,10);
zway.devices[9].instancds[0].ThermostatSetPoint.Set(1,setTemp) ;
Z-Way 1.7.2; Raspberry Pi B+
etrust
Posts: 27
Joined: 24 Feb 2014 20:27

Re: set termostat value in module

Post by etrust »

Hi Guys,

I can control my lights using http request very well. I am searching the http request to setup temperature. Can somebody show me an url example to be able to setup the temperature for my Danfoss Thermostat?

Thanks
LAN-Opfer
Posts: 98
Joined: 03 Oct 2014 13:23

Re: set termostat value in module

Post by LAN-Opfer »

Z-Way v2.0.1-rc18 on Raspberry Pi
Post Reply