Thanks for trying to help me Micke, but i seem to need to have this in with a spoon
I think I understand the Sensortype flags, but i dont understand what the scale flags does. Is the sensortype and scale connected in some way ? How do i know witch one is supposed to be connected.
Lets say i have a sensor thats pops up as a temperature sensor in live.telldus.com called "MySensor" . I want this sensor to be converted to a "Volt sensor"
Will this psudo lua code do the trick to convert the temperature sensor to a volt sensor in live.telldus.com ? I am using the sensortype "UNKNOWN" beacuse i dont know witch one to use with the SCALE_POWER_VOLT scaletype.
Code: Select all
SCALE_POWER_VOLT = 4
UNKNOWN = 0
local deviceManager = require "telldus.DeviceManager"
local sensor = deviceManager:findByName("MySensor")
function onSensorValueUpdated(device, valueType, value, scale)
if device:id() == sensor:id()
{
sensor:setSensorValue(UNKNOWN, value, SCALE_POWER_VOLT)
}