Esempio n. 1
0
 def mode_off(self, radiator):
     if radiator in self.radiators.keys():
         try:
             t = Thermostat(self.radiators[radiator])
             t.mode = Mode.Closed
             return t.mode_readable
         except:
             return 'timeout'
Esempio n. 2
0
 def mode_manual(self, radiator, temp):
     if radiator in self.radiators.keys():
         try:
             t = Thermostat(self.radiators[radiator])
             t.mode = Mode.Manual
             t.target_temperature = temp
             return self.__print_temp(t.mode_readable)
         except:
             return 'timeout'
Esempio n. 3
0
# IOBroker->Script - Setze den Temperaturwert im Thermostat 
def setEQTemp(sMAC, sTemp):
    thermostat = Thermostat(sMAC)
    thermostat.target_temperature = float(sTemp)
    thermostat.update()

# Pruefe bei aufruf des Script die mitgegebenen Parameter
if len(sys.argv) > 1:
    # Mehr als 1 Parameter, dann setze Temp im Thermostat
    sZimmer = sys.argv[1]
    sTemp = sys.argv[2]
    nArrID = aZimmer.index(sZimmer)
    setEQTemp(aMacs[nArrID], sTemp)
else:
    # Kein Parameter, dann aktualisere Werte im IOBroker für jeden definierten Themostat
    for i in range(len(aMacs)):
        thermostat = Thermostat(aMacs[i])
        thermostat.update()
        # Wenn Mode Closed gesetzt am Thermostat, dann setzen wird Mode Manual (5 Grad), sonst gibts Probleme
        if str(thermostat.mode) == "Mode.Closed":
            print("setmode")
            thermostat.mode = 3
            thermostat.update()
        # Debug
        print(str(thermostat.mode) + " : " + str(thermostat.target_temperature) + " : " + str(thermostat.valve_state))
        # Setze Werte im IOBroker
        setIOTemp(aZimmer[i],thermostat.target_temperature)
        setIOValve(aZimmer[i],thermostat.valve_state)
        setIOAlarm(aZimmer[i],thermostat.low_battery)
Esempio n. 4
0
from eq3bt import Thermostat
import subprocess
import sys
import time

if len(sys.argv) > 1:
    # CMD Parameter
    if sys.argv[1] == "check":      #Check
        print("eq3OK")

    if sys.argv[1] == "getValue":   #Get Informatioms from BTDevice
        thermostat = Thermostat(sys.argv[2])
        thermostat.update()
        if str(thermostat.mode) == "Mode.Closed":
            thermostat.mode = 3   #Set Mode Manual
            thermostat.update()
        print(str(thermostat.target_temperature) + ";" + str(thermostat.valve_state)  + ";" + str(thermostat.low_battery))
        time.sleep(1)

    if sys.argv[1] == "setValue":   #Set Temperature to BTDevice
        thermostat = Thermostat(sys.argv[2])
        thermostat.target_temperature = float(sys.argv[3])
        thermostat.update()
        print ("OK")

else:
    print("Possible Arguments:");
    print("   check");
    print("   getValue [MAC]");
    print("   setValue [MAC] [Temperature]");