jperkin / node-openzwave

node.js interface to libopenzwave
Other
110 stars 55 forks source link

How to use setValue? #44

Closed kevinsimper closed 9 years ago

kevinsimper commented 9 years ago

Sorry if this is a beginner question, but I could not find any information about it sadly.

I am trying to change the value of a Thermostat that i have connected, but I don't know who to do it. I tried a lot of combinations, but i can't seems to get it right.

I get this from the test script and specified me into the class that is want to change:

node3: node awake
node3: Danfoss, Z Thermostat
node3: name="", type="Setpoint Thermostat", location=""
node3: class 32
node3: class 67
node3:   Heating 1=21
node3: class 70
node3:   Monday=0
node3:   Tuesday=0
node3:   Wednesday=0
node3:   Thursday=1
node3:   Friday=0
node3:   Saturday=0
node3:   Sunday=0
node3:   Override State=0
node3:   Override Setback=127
node3: class 117
node3:   Protection=0
node3: class 128
node3:   Battery Level=100
node3: class 129
node3:   Day=0
node3:   Hour=1
node3:   Minute=32
node3: class 132
node3:   Wake-up Interval=300
node3:   Minimum Wake-up Interval=60
node3:   Maximum Wake-up Interval=900
node3:   Default Wake-up Interval=300
node3:   Wake-up Interval Step=60
node3: class 134
node3:   Library Version=6
node3:   Protocol Version=2.67
node3:   Application Version=2.51

This is the exact object of class 67

{ '1':
   { type: 'decimal',
     genre: 'user',
     instance: 1,
     index: 1,
     label: 'Heating 1',
     units: 'C',
     read_only: false,
     write_only: false,
     min: 0,
     max: 0,
     value: 21 } }

I have tried running this code:

zwave.setValue('node3', '67', '1', '24')
zwave.setValue('node3', '67', '1', 24)

in both the node ready event and driver ready.

<CommandClass id="67" name="COMMAND_CLASS_THERMOSTAT_SETPOINT" version="1" request_flags="4" override_precision="2" base="0">
                <Instance index="1" />
                <Value type="decimal" genre="user" instance="1" index="1" label="Heating 1" units="C" read_only="false" write_only="false" verify_changes="true" poll_intensity="0" min="0" max="0" value="21.00" />
            </CommandClass>

Rest of it https://gist.github.com/kevinsimper/eac358a6bbc8b3db8291

Thanks for any advice! Much appreciated!

ekarak commented 9 years ago

have you tried passing the values as integers? ie zwave.setValue(3, 67, 1, 24)

kevinsimper commented 9 years ago

@ekarak Thanks, just the advice i needed, I tried changing the nodeid and this code works

zwave.setValue('3', '67', '1', '25')

This changes the temperature to 25 degrees.

profpohl commented 7 years ago

For me this is not working. I have a Danfoss (Devolo) thermostat too. I tried (in node-red): newMsg.topic = "setValue"; newMsg.payload =['17', '67', '1', '25']; newMsg.topic = "setValue"; newMsg.payload =[17, 67, 1, 25]; newMsg.topic = "setValue"; newMsg.payload =[17, 67, 1, 0, 25]; newMsg.topic = "setValue" newMsg.payload = { "args": [17, 24]}; ... but always get error: TypeError: setValue: OpenZWave valueId not found However, if I do: newMsg.topic = "getNodeStatistics"; newMsg.payload = { "args": [17]}; I get the expected answer. Has anyone an idea...

ekarak commented 7 years ago

wait a minute - wrong repo. This is the initial Node OpenZWave repo from which I forked and produced openzwave-shared. I think this one's still hasn't got support for valueID inidices.