Looking to get temp readings from a 4 channel temperature sensor in scripting, but not having any luck The helper code snippet shows the following - Code: -- Get temperature and units of channel 1 of sensor 1 on the local network -- temp is a float and units is a string (eg '°C') temp, units = GetCBusMeasurement('Local', 'sensor1', 1) And the C-Bus function code snippet shows Code: GetCBusMeasurement(net, ua, channel) So my temp sensor is network 254 and address 33 Code: temp, units = GetCBusMeasurement(254, 33, 1) And I get the following error - Library cbuslogic:0: unable to find 254/228/33/1 stack traceback: [C]: in function 'error' Library cbuslogic: in function 'GetCBusMeasurement' So I tried the measurement device ID (I know, but I figured what the hell) - 166 and got the same error What have I missed?
Hi Maybe your network address should be the name not the number, same as the sensor unit address. temp, units = GetCBusMeasurement('networkname', 'unitname', 1) I don't have a temp sensor to test with. Not sure what the automation controller will do with that data either you may need to set another object with the value returned from that query.
Thanks Daggo. LUA script will accept either network name or address. Will add some more script once I stop getting errors, ie. log(temp) for debugging.
Discovered my issue - each channel needs an object created with the measurement ID and channel. Obviously this doesn't exist on Toolkit so never occurred to me. Although the script still faulted with 'unable to decode' error with the temp, units format, I removed the units format and it works perfectly (down to no less than 13 decimal places ) Current temp - 29.3099994659424