Ejemplo n.º 1
0
 def send2ampi(self, aktion, par):
     cmd = {"Aktion": aktion, "Parameter": par}
     json_cmd = json.dumps(cmd)
     ret = udpRemote(json_cmd,
                     addr=self.ampiConfig[2],
                     port=self.ampiConfig[3])
     if (ret != -1):
         for key in ret.items():
             print(key)
         self.statusSignal.emit(ret['Antwort'] + ": " + par)
Ejemplo n.º 2
0
    def _updateOekofen(self):
        while (not self.tStop.is_set()):
            try:
                json_string = '{"command" : "getOekofendata"}'
                d = remote.udpRemote(json_string, addr="dose", port=6663)
                self.lbl_pe1_status.setText(str(d["pe1"]["L_statetext"]))
                self.lbl_pe1_modulation.setText(
                    str(d["pe1"]["L_modulation"]) + "%")
                self.lbl_pe1_temp_act.setText(
                    str(float(d["pe1"]["L_temp_act"]) / 10) + " °C")
                self.lbl_pe1_avg_runtime.setText(
                    str(float(d["pe1"]["L_avg_runtime"])) + " min")
                self.lbl_hk1_flowtemp_set.setText(
                    str(float(d["hk1"]["L_flowtemp_set"]) / 10) + " °C")
                self.lbl_hk1_flowtemp_act.setText(
                    str(float(d["hk1"]["L_flowtemp_act"]) / 10) + " °C")
                self.lbl_pu1_tpo_act.setText(
                    str(float(d["pu1"]["L_tpo_act"]) / 10) + " °C")
                self.lbl_pu1_tpm_act.setText(
                    str(float(d["pu1"]["L_tpm_act"]) / 10) + " °C")
                self.lbl_sk1_spu.setText(
                    str(float(d["sk1"]["L_spu"]) / 10) + " °C")
                self.lbl_sk1_koll_temp.setText(
                    str(float(d["sk1"]["L_koll_temp"]) / 10) + " °C")
                self.lbl_sk1_pump.setText(str(d["sk1"]["L_pump"]) + " %")
                self.lbl_sk3_koll_temp.setText(
                    str(float(d["sk3"]["L_koll_temp"]) / 10) + " °C")
                self.lbl_sk3_pump.setText(str(d["sk3"]["L_pump"]) + " %")
                self.lbl_se2_flow_temp.setText(
                    str(float(d["se2"]["L_flow_temp"]) / 10) + " °C")
                self.lbl_se2_ret_temp.setText(
                    str(float(d["se2"]["L_ret_temp"]) / 10) + " °C")
                self.lbl_se2_day.setText(
                    str(float(d["se2"]["L_day"]) / 10) + " kWh")
                self.lbl_se2_yesterday.setText(
                    str(float(d["se2"]["L_yesterday"]) / 10) + " kWh")
                st_fill = str(d["pe1"]["L_storage_fill"]) + " kg"
                st_popper = str(d["pe1"]["L_storage_popper"]) + " kg"
                self.lbl_pe1_storage_fill.setText(st_fill)
                self.lbl_pe1_storage_popper.setText(st_popper)

            except Exception as e:
                self.statusSignal.emit("Fehler " + str(e))
                print(str(e))
            self.tStop.wait(11)
Ejemplo n.º 3
0
    def get_oekofen_pumpe(self):
        """ Get status from Oekofen heating pump
        Retries, if no response

        """
        if(self.oekofen == 0):
            # Do not get state of heating system, just return true to simulate a running heating pump
            logger.debug("Not taking Oekofen state into account")
            ret = True
        else:
            ret = -1
            while(ret == -1):
                try:
                    json_string = '{"command" : "getUmwaelzpumpe"}'
                    ret = remote.udpRemote(json_string, addr=server, port=datacenterport)["answer"]
                except:
                    ret = -1
                    time.sleep(1)
            if(ret in ["true", "True", "TRUE"]):
                ret = True
            else:
                ret = False
        return(ret)
Ejemplo n.º 4
0
 def torAufZu(self):
     json_cmd = '{"command" : "setTor" , "Request":"auf"}\n'
     self.labelStatus.setText("Warte kurz")
     ret = udpRemote(json_cmd, addr="piesler", port=5005)
Ejemplo n.º 5
0
 def get_timer(self, room):
     cmd = {"command": "getTimer", "Room": room}
     ans = udpRemote(json.dumps(cmd), addr=self.host, port=5005)
     return (ans)