PDA

View Full Version : Speak Humidity level from Bobcat



jwilson56
November 7th, 2008, 08:46 AM
local path = 'Fordrat8\\Ocelot\\Ocelot.Module4.Bobcat-H'
local device = DeviceManager:GetDeviceUsingPath (path)
if device then
device:Print ()
else
print ('No Device')
end
local controlid = 'Humidity'
local control = device:GetControl (controlid)
if control then
print (control:GetValue())
Voice:Speak("Living Room Humidity is"..control:GetValue().."percent")
end

hoox
November 8th, 2008, 11:20 AM
FYI, the component has two shortcuts, that just need the device ID.

To get the value from the latest update:

local v = Ocelot:GetValue('Ocelot.Module3.Bobcat-H')
To send commands:

Ocelot:SetValue('Ocelot.LocalIR', 'IRName')
Ocelot:SetValue('Ocelot.Module1.Zone0', 'IRName')
Ocelot:SetValue('Ocelot.Module2.Relay0', 'On') --or 'Off'
Ocelot:SetValue('Ocelot.Timer0', 1)
Ocelot:SetValue('Ocelot.Variable0', 1)

jwilson56
November 8th, 2008, 11:41 AM
Thanks for the shortcut