Thanks Bill.
Sent from my iPhone using Tapatalk
4billl wrote:If you know of good script I'd appreciate it.
Better yet, maybe you could build in a simple scaling field in the analog device driver.
# Get the original device state value. You must change this to match your device ID and state name.
var = indigo.devices[514960551].states["thing1"]
# Round off the value after multiplying it by your scaling factor. Change the '10' to whatever value you like.
new_var = round(var * 10.0)
# Convert it to an integer.
new_var_int = int(new_var)
# Make it a string, because Indigo variables are always strings.
new_var_str = str(new_var_int)
# Write the value to the variable. You must change this to match your variable ID.
indigo.variable.updateValue(314742858, new_var_str)
• HTTP—service provides delivery of html and xml data files via http get, a method of writing data to 1-Wire devices
• SNMP—provides access to data from all connected sensors, and pushes SNMP traps to remote listeners for alarming capabilities
• Telnet—service provides login to monitor some of the OW-SERVER-ENET-2’s communication activities for diagnostic purposes
• UDP Broadcast—listener on port number 30303 will respond to properly formatted pack- ets broadcast to this port number, allowing other devices and applications to discover OW-SERVER-ENET-2s that exist on the same network.
• 1-Wire Interface—service provides a TCP client that implements a command / response low level interface that may be used to directly control the 1-Wire bus
• POST Client—provides a method of pushing XML data about connected 1-Wire devices to a server.
4billl wrote:So I also tried commenting out the new_var_int and keeping the new_var as a float - got the same error.
# Get the original device state value. You must change this to match your device ID and state name.
var = int(indigo.devices[115794742].states["owsv0to10VoltInput1Instant"])
# Round off the value after multiplying it by your scaling factor. Change the '10' to whatever value you like.
new_var = round(var * 10.0)
# Convert it to an integer.
new_var_int = int(new_var)
# Make it a string, because Indigo variables are always strings.
new_var_str = str(new_var_int)
# Write the value to the variable. You must change this to match your variable ID.
indigo.variable.updateValue(817410106, new_var_str)
# Get the original device state value. You must change this to match your device ID and state name.
var = float(indigo.devices[115794742].states["owsv0to10VoltInput1Instant"])
# Round off the value after multiplying it by your scaling factor. Change the '10' to whatever value you like.
new_var = round(var * 10.0)
# Convert it to an integer.
new_var_int = int(new_var)
# Make it a string, because Indigo variables are always strings.
new_var_str = str(new_var_int)
# Write the value to the variable. You must change this to match your variable ID.
indigo.variable.updateValue(817410106, new_var_str)
var = float(indigo.devices[115794742].states["owsv0to10VoltInput1Instant"])
new_var = var * 10.0
new_var_str = str("%0.1f" % new_var)
indigo.variable.updateValue(817410106, new_var_str)
Users browsing this forum: No registered users and 0 guests