MarcoGT wrote:How do you turn it on and off? Using MQTT?
I am using 2 actions that run either On or Off python scripts
- Code: Select all
# Shelly Turn Off
import urllib2
import socket
ShellyIP = "192.168.100.236"
TurnOn = "/relay/0?turn=on"
TurnOff = "/relay/0?turn=off"
#url_cmd = "http://" + ShellyIP + TurnOn
url_cmd = "http://" + ShellyIP + TurnOff
indigo.server.log(u"Sending to Shelly at " + ShellyIP)
try:
response = urllib2.urlopen(url_cmd)
response.read()
response.close()
except socket.timeout:
indigo.server.log(u"Timed out when talking to Shelly at " + ShellyIP)
except urllib2.URLError, e:
if hasattr(e, 'reason'):
indigo.server.log(u"Error: We failed to find Shelly at " + ShellyIP)
indigo.server.log("Reason: " + str(e.reason))
elif hasattr(e, 'code'):
indigo.server.log(u"Error: The Shelly couldn\'t fulfill the request.")
indigo.server.log("Error code: " + str(e.code))
else:
indigo.server.log(u"Sent to Shelly at " + ShellyIP)
FlyingDiver wrote:
Yes, I have been staring at it all day but can't get my head around Mosquitto, MQTT plugin, Shims plugin and Shelly.
If anyone gets a Shelly and installs with these plugins please can you put a "how to" here (in idiot steps) and I will be eternally grateful