I wrote that wrong.
You should make a new device in indigo and assign a google voice number to it.
Then, choose that device when you make the trigger.
Sorry for the confusion.
The docs for the plugin are pretty straightforward.
dave
Chompy wrote:Is there any way to keep this plugin connected to Google Voice? I am having issues with the plugin disconnecting after a period of inactivity.
I attempted to setup a timer to reload the plugin, but I'm not sure how to go about doing so.
plugin = indigo.server.getPlugin("com.chrisandlynette.indigoplugin.googleVoiceSMS")
if plugin.isEnabled():
plugin.restart()
Feb 17, 2012 10:45:38 AM
Reloading plugin "Google Voice SMS 1.1.0"
Stopping plugin "Google Voice SMS 1.1.0" (pid 5005)
Error because embedded scripts execute sequentially they must complete their execution within 10 seconds.
Error modify the script to exit quickly or convert it to an external file (not embedded).
Stopping embedded script executor host (pid 5464)
Script Error embedded script: ServerCommunicationError -- timeout waiting for server response
Script Error Exception Traceback (most recent call shown last):
embedded script, line 3, at top level
StandardError: ServerCommunicationError -- timeout waiting for server response
Error process (pid 5005) failed to quit after polite request -- forcing it to quit now
Starting plugin "Google Voice SMS 1.1.0" (pid 5522)
Plugin "Google Voice SMS" disconnected
Plugin "Google Voice SMS" connected
Plugin "Google Voice SMS 1.1.0" started
Google Voice SMS Logging in to your Google Voice account.
Google Voice SMS Successfully logged in to: zzzzzxxxxxxzzzz@gmail.com
...
def verifyDevice(self, device, cell, msg, time):
smsNumber = device.pluginProps['address']
if smsNumber == cell[2:12]:
indigo.server.log("Time: "+time+" From: "+cell+" MSG: "+msg+" *authorized*")
device.updateStateOnServer(key="receivedText", value="") # cleared in case the same message is received
device.updateStateOnServer(key="receivedText", value=msg.lower().strip().strip('.'))
indigo.variable.updateValue("messageText", msg.lower()) ## add this line to update messageText variable
verified = True
#variable containing SMS message
message = indigo.variables[680980532].value
#define thermostat device
myThermostat = indigo.devices[53622306]
#set the Id of your phone
myPhoneId = 839260238
########################################
# change variables above
########################################
#get current ambient temperature
currTemp = str(int(myThermostat.temperatures[0]))
#instantiate the Google Voice Plugin
googleVoiceId = "com.chrisandlynette.indigoplugin.googleVoiceSMS"
googleVoicePlugin = indigo.server.getPlugin(googleVoiceId)
text = ""
#function for sending SMS messages via Google Voice Plugin
def sendSMS(text):
indigo.server.log("Sending message: " + text)
if googleVoicePlugin.isEnabled():
googleVoicePlugin.executeAction("sendSMS", deviceId=myPhoneId, props={'smsMessage':text})
if "set temp to" in message or "set temperature to" in message or "set heat to" in message:
temperature = message.split()[3]
#turn on heat if off
if myThermostat.hvacMode != indigo.kHvacMode.Heat:
indigo.thermostat.setHvacMode(myThermostat, value=indigo.kHvacMode.Heat)
text += "Heat turned on. (was off) "
#change setpoint
if myThermostat.heatSetpoint != float(temperature):
indigo.thermostat.setHeatSetpoint(myThermostat, value=eval(temperature))
text += "Setpoint changed to " + temperature + ". "
else:
text += "Setpoint already " + temperature + ". "
#send SMS confirmation
text += "Current temperature is " + currTemp + "."
sendSMS(text)
elif message == "heat off" or message == "heater off":
indigo.thermostat.setHvacMode(myThermostat, value=indigo.kHvacMode.Off)
elif message == "current temp" or message == "current temperature":
#SMS current temperature
sendSMS("Current temperature is " +currTemp)
Andy B. wrote:I've been using the script posted by "eme jota ce" to reload the Google Voice SMS plugin with great success. Has anyone figured out the maximum time interval to run the script? I have the script run every 1 hour, but didn't know if anyone has had success running it less often.
Users browsing this forum: No registered users and 1 guest