Page 8 of 15

Re: Opentherm gateway and script integration into Homeseer

Posted: Wed Dec 12, 2012 10:14 pm
by raymonvdm
Opzich gebruik ik hetzelfde voor mijn OTg en voor mijn chromoflex RGB controller beide met 10 meter utp. Ik heb alleen enkelvoudige usb naar compoort verloop

Re: Opentherm gateway and script integration into Homeseer

Posted: Wed Dec 12, 2012 10:55 pm
by abl
Sorry for my bit off-topic question, but tomorrow my heating technician will pay us a visit for normal maintenance. I've asked him whether he would be able to place an opentherm compliant installation.

His answer:
The boilers that we place are of the brand Junkers. In Belgium these boilers are normally placed with their own control. In the Netherlands they provide these boilers sometimes with an Open-Therm system. Personally, I don't see any advantage in this system as the standard control system of the boiler Junkers send all information to the thermostat.

But my question would be if I would then still be able to control the heating installation via Homeseer or that I could better look for another installation?

Re: Opentherm gateway and script integration into Homeseer

Posted: Thu Dec 13, 2012 12:32 am
by raymonvdm
It depends on the capabilities of the thermostat. For example Honeywell has some thermostats for OpenTherm and On/Off boilers with a TELE contact. Using this TELE contact you can force the thermostat to go in an additional program.

Normal mode is low temperature
TELE contact closed is high temperature

It is some kind of control but not very advanced

P.S. Maybe you can replace the Boiler control yourself. I know it is possible with my boiler to switch between On/Off or OpenTherm

Re: Opentherm gateway and script integration into Homeseer

Posted: Sat Dec 15, 2012 1:49 am
by raymonvdm
Tonight i bought myself another thermostat (Honeywell Round Modulation) and now the gateway is working as designed (the previous thermostat did not had a setpoint to set)

Now the only problem left is that i`m unable to use the "virtual device" which should be created as a droplist device. The device is there but the droplist is not. I`m now forced to set the Day and Night temp using two scripts. However this is working i want to be able to set the temp in steps of 0.5 degrees

Re: Opentherm gateway and script integration into Homeseer

Posted: Sat Dec 15, 2012 4:49 pm
by Rutger
I don't have this dropdown list eighter, so I created a second script who creates one extra virtual device with extra control buttons and this dropdown list.
An advantage at the moment for me is that the buttons can be used in Hstouch also. With 'Set' you activate the definitly temperature. Probably also possible via an other way.....
The script copy the value at the moment to the temporary 'Kamerthermostaat' device. If this script works fine, one of the devices could be deleted.

Re: Opentherm gateway and script integration into Homeseer

Posted: Sun Dec 16, 2012 12:10 am
by raymonvdm
How did you create this device. Using the HomeSeer interface i`m able to create a virtual device but thats all.

When you look at post 1 of this topic it seems that Rutger has something to do with the expension of the 7th virtual device. I think thats you :mrgreen: Please tell us more


I`m no script guru but i think there is an issue with the original script. Or maybe i just don`t understand how al variables are set for the creation of the device

Code: Select all


	' Create listbox for Kamerthermostaat - tijdelijk
	hs.DeviceValuesAdd(strHC & CStr(C1), _
		"OFF" & chr(2) & "0" & chr(1) & _
		"12.0" & chr(2) & "120" & chr(1) & _
		"12.5" & chr(2) & "125" & chr(1) & _
		"13.0" & chr(2) & "130" & chr(1) & _
		"13.5" & chr(2) & "135" & chr(1) & _
		"14.0" & chr(2) & "140" & chr(1) & _
		"14.5" & chr(2) & "145" & chr(1) & _
		"15.0" & chr(2) & "150" & chr(1) & _
		"15.5" & chr(2) & "155" & chr(1) & _
		"16.0" & chr(2) & "160" & chr(1) & _
		"16.5" & chr(2) & "165" & chr(1) & _
		"17.0" & chr(2) & "170" & chr(1) & _
		"17.5" & chr(2) & "175" & chr(1) & _
		"18.0" & chr(2) & "180" & chr(1) & _
		"18.5" & chr(2) & "185" & chr(1) & _
		"19.0" & chr(2) & "190" & chr(1) & _
		"19.5" & chr(2) & "195" & chr(1) & _
		"20.0" & chr(2) & "200" & chr(1) & _
		"20.5" & chr(2) & "205" & chr(1) & _
		"21.0" & chr(2) & "210" & chr(1) & _
		"21.5" & chr(2) & "215" & chr(1) & _
		"22.0" & chr(2) & "220" & chr(1) & _
		"22.5" & chr(2) & "225" & chr(1) & _
		"23.0" & chr(2) & "230" & chr(1) & _
		"23.5" & chr(2) & "235" & chr(1) & _
		"24.0" & chr(2) & "240" & chr(1) & _
		"24.5" & chr(2) & "245" & chr(1) & _
		"25.0" & chr(2) & "250" & chr(1) & _
		"Any Value" & chr(2) & "999", true)
		
End Function  



Re: Opentherm gateway and script integration into Homeseer

Posted: Sun Dec 16, 2012 11:06 am
by Rutger

Code: Select all

Sub Main(ByVal Parms As String)
' Created by 	: Rutger Bockholts
' Version 		: 1.0
' Date		: 15-12-2012
' This script will create a virtual device, status only, and add the control buttons Up, Down, Set, Night, and a dropdown list with degrees.
' Usable with "BLB_OT_monitor_02.vb" script for the OpenTherm Gateway
' DeviceTherm "H7" is the device "Kamerthermostaat-Tijdelijk" which is created by the "BLB_OT_monitor_02.vb" script.
' DeviceCode "H9" is the virtual device in this script.

Dim DeviceTherm As String = "H7"
Dim DeviceCode As String = "H9"

Dim DevExists As String
Try
	DevExists = hs.DeviceExists(Devicecode) 
	If DevExists = -1 Then 
        Dim devicenew As Integer
        Dim device As Scheduler.Classes.DeviceClass
        devicenew = hs.NewDeviceRef("OTGW Temperature")
        device = hs.GetDeviceByRef(devicenew)
		device.misc = &h10
		device.can_dim = "false"
		'device.iotype = IOTYPE_CONTROL
		device.dev_type_string = "Status Only"
		device.location = "Zolder"
		device.location2 = "OpenTherm"
        device.hc = left(DeviceCode,1) 
        device.dc = Mid(DeviceCode,2)
	
		' Create Controlbuttons: Night, Up, Down, Set
		hs.devicebuttonadd(DeviceCode, "OT_H9_Device_Control.vb(""Main"", ""Night"")", "Night")
		hs.devicebuttonadd(DeviceCode, "OT_H9_Device_Control.vb(""Main"", ""Up"")", "Up")
		hs.devicebuttonadd(DeviceCode, "OT_H9_Device_Control.vb(""Main"", ""Down"")", "Down")
		hs.devicebuttonadd(DeviceCode, "OT_H9_Device_Control.vb(""Main"", ""Set"")", "Set")
		
		' Create Controlbutton: Dropdownlist with degrees 
		hs.DeviceValuesAdd(DeviceCode, _
			"12.0" & chr(2) & "120" & chr(1) & _
			"12.5" & chr(2) & "125" & chr(1) & _
			"13.0" & chr(2) & "130" & chr(1) & _
			"13.5" & chr(2) & "135" & chr(1) & _
			"14.0" & chr(2) & "140" & chr(1) & _
			"14.5" & chr(2) & "145" & chr(1) & _
			"15.0" & chr(2) & "150" & chr(1) & _
			"15.5" & chr(2) & "155" & chr(1) & _
			"16.0" & chr(2) & "160" & chr(1) & _
			"16.5" & chr(2) & "165" & chr(1) & _
			"17.0" & chr(2) & "170" & chr(1) & _
			"17.5" & chr(2) & "175" & chr(1) & _
			"18.0" & chr(2) & "180" & chr(1) & _
			"18.5" & chr(2) & "185" & chr(1) & _
			"19.0" & chr(2) & "190" & chr(1) & _
			"19.5" & chr(2) & "195" & chr(1) & _
			"20.0" & chr(2) & "200" & chr(1) & _
			"20.5" & chr(2) & "205" & chr(1) & _
			"21.0" & chr(2) & "210" & chr(1) & _
			"21.5" & chr(2) & "215" & chr(1) & _
			"22.0" & chr(2) & "220" & chr(1) & _
			"22.5" & chr(2) & "225" & chr(1) & _
			"23.0" & chr(2) & "230" & chr(1) & _
			"23.5" & chr(2) & "235" & chr(1) & _
			"24.0" & chr(2) & "240" & chr(1) & _
			"24.5" & chr(2) & "245" & chr(1) & _
			"25.0" & chr(2) & "250" & chr(1) & _
			"Any Value" & chr(2) & "999", true)
		hs.writelog ("Info","New device is created")
	End If
Catch ex As Exception
		hs.writelog ("Info","No new device is created")
End Try

' Action for Controlbuttons
Select Case Parms
	Case "Night"
	hs.setdevicevalue(DeviceCode, 180)
	hs.setdevicestring(DeviceCode, "Night", 180)

Case "Up"
	hs.setdevicevalue(DeviceCode, hs.devicevalue(DeviceCode) + 5)
	hs.setdevicestring(DeviceCode, hs.devicevalue(DeviceCode) + 5, True)

	
Case "Down"
	hs.setdevicevalue(DeviceCode, hs.devicevalue(DeviceCode) - 5)
	hs.setdevicestring(DeviceCode, hs.devicevalue(DeviceCode) - 5, True)

	
Case "Set"
	hs.setdevicevalue(DeviceTherm, (hs.devicevalue(DeviceCode)))

End Select


	If (hs.devicevalue(devicecode) = 160) Then
        hs.SetDeviceValue(DeviceTherm, 16)
    End If
    If (hs.devicevalue(DeviceCode) = 165) Then
        hs.SetDeviceValue(DeviceTherm, 16.5)
    End If
    If (hs.devicevalue(DeviceCode) = 170) Then
        hs.SetDeviceValue(DeviceTherm, 17)
    End If
    If (hs.devicevalue(DeviceCode) = 175) Then
        hs.SetDeviceValue(DeviceTherm, 17.5)
    End If
    If (hs.devicevalue(DeviceCode) = 180) Then
        hs.SetDeviceValue(DeviceTherm, 18)
    End If
    If (hs.devicevalue(DeviceCode) = 185) Then
        hs.SetDeviceValue(DeviceTherm, 18.5)
    End If
    If (hs.devicevalue(DeviceCode) = 190) Then
        hs.SetDeviceValue(DeviceTherm, 19)
    End If
	If (hs.devicevalue(DeviceCode) = 195) Then
        hs.SetDeviceValue(DeviceTherm, 19.5)
    End If
	If (hs.devicevalue(DeviceCode) = 200) Then
        hs.SetDeviceValue(DeviceTherm, 20)
    End If
	If (hs.devicevalue(DeviceCode) = 205) Then
        hs.SetDeviceValue(DeviceTherm, 20.5)
    End If
	If (hs.devicevalue(DeviceCode) = 210) Then
        hs.SetDeviceValue(DeviceTherm, 21)
	End If
	If (hs.devicevalue(DeviceCode) = 215) Then
        hs.SetDeviceValue(DeviceTherm, 21.5)
    End If
	If (hs.devicevalue(DeviceCode) = 220) Then
        hs.SetDeviceValue(DeviceTherm, 22)
    End If
	If (hs.devicevalue(DeviceCode) = 225) Then
        hs.SetDeviceValue(DeviceTherm, 22.5)
    End If
	If (hs.devicevalue(DeviceCode) = 230) Then
        hs.SetDeviceValue(DeviceTherm, 23)
    End If
	If (hs.devicevalue(DeviceCode) = 235) Then
        hs.SetDeviceValue(DeviceTherm, 23.5)
    End If
	If (hs.devicevalue(DeviceCode) = 240) Then
        hs.SetDeviceValue(DeviceTherm, 24)
    End If
	If (hs.devicevalue(DeviceCode) = 245) Then
        hs.SetDeviceValue(DeviceTherm, 24.5)
    End If
	If (hs.devicevalue(DeviceCode) = 250) Then
        hs.SetDeviceValue(DeviceTherm, 25)
    End If

End Sub

Re: Opentherm gateway and script integration into Homeseer

Posted: Mon Dec 17, 2012 8:01 pm
by Rutger
Above my updated script.

Re: Opentherm gateway and script integration into Homeseer

Posted: Tue Dec 18, 2012 12:36 am
by raymonvdm
I have tried the "new" script and get the device i expected. However i do not have the OT_XX_Device_Control.vb script.

This is my current device creation script

Code: Select all


Sub Main(ByVal Parms As String)
' Created by    : Rutger Bockholts
' Version       : 1.0
' Date      : 15-12-2012
' This script will create a virtual device, status only, and add the control buttons Up, Down, Set, Night, and a dropdown list with degrees.
' Usable with "BLB_OT_monitor_02.vb" script for the OpenTherm Gateway
' DeviceTherm "H7" is the device "Kamerthermostaat-Tijdelijk" which is created by the "BLB_OT_monitor_02.vb" script.
' DeviceCode "H9" is the virtual device in this script.

Dim DeviceTherm As String = "O7"
Dim DeviceCode As String = "O8"

Dim DevExists As String
Try
   DevExists = hs.DeviceExists(Devicecode) 
   If DevExists = -1 Then 
        Dim devicenew As Integer
        Dim device As Scheduler.Classes.DeviceClass
        devicenew = hs.NewDeviceRef("OTGW Temperature")
        device = hs.GetDeviceByRef(devicenew)
      device.misc = &o10
      device.can_dim = "false"
      'device.iotype = IOTYPE_CONTROL
      device.dev_type_string = "Status Only"
      device.location = "Zolder"
      device.location2 = "CV"
        device.hc = left(DeviceCode,1) 
        device.dc = Mid(DeviceCode,2)
   
      ' Create Controlbuttons: Night, Up, Down, Set
      hs.devicebuttonadd(DeviceCode, "OT_O8_Device_Control.vb(""Main"", ""Night"")", "Night")
      hs.devicebuttonadd(DeviceCode, "OT_O8_Device_Control.vb(""Main"", ""Up"")", "Up")
      hs.devicebuttonadd(DeviceCode, "OT_O8_Device_Control.vb(""Main"", ""Down"")", "Down")
      hs.devicebuttonadd(DeviceCode, "OT_O8_Device_Control.vb(""Main"", ""Set"")", "Set")
      
      ' Create Controlbutton: Dropdownlist with degrees 
      hs.DeviceValuesAdd(DeviceCode, _
         "12.0" & chr(2) & "120" & chr(1) & _
         "12.5" & chr(2) & "125" & chr(1) & _
         "13.0" & chr(2) & "130" & chr(1) & _
         "13.5" & chr(2) & "135" & chr(1) & _
         "14.0" & chr(2) & "140" & chr(1) & _
         "14.5" & chr(2) & "145" & chr(1) & _
         "15.0" & chr(2) & "150" & chr(1) & _
         "15.5" & chr(2) & "155" & chr(1) & _
         "16.0" & chr(2) & "160" & chr(1) & _
         "16.5" & chr(2) & "165" & chr(1) & _
         "17.0" & chr(2) & "170" & chr(1) & _
         "17.5" & chr(2) & "175" & chr(1) & _
         "18.0" & chr(2) & "180" & chr(1) & _
         "18.5" & chr(2) & "185" & chr(1) & _
         "19.0" & chr(2) & "190" & chr(1) & _
         "19.5" & chr(2) & "195" & chr(1) & _
         "20.0" & chr(2) & "200" & chr(1) & _
         "20.5" & chr(2) & "205" & chr(1) & _
         "21.0" & chr(2) & "210" & chr(1) & _
         "21.5" & chr(2) & "215" & chr(1) & _
         "22.0" & chr(2) & "220" & chr(1) & _
         "22.5" & chr(2) & "225" & chr(1) & _
         "23.0" & chr(2) & "230" & chr(1) & _
         "23.5" & chr(2) & "235" & chr(1) & _
         "24.0" & chr(2) & "240" & chr(1) & _
         "24.5" & chr(2) & "245" & chr(1) & _
         "25.0" & chr(2) & "250" & chr(1) & _
         "Any Value" & chr(2) & "999", true)
      hs.writelog ("Info","New device is created")
   End If
Catch ex As Exception
      hs.writelog ("Info","No new device is created")
End Try

' Action for Controlbuttons
Select Case Parms
   Case "Night"
   hs.setdevicevalue(DeviceCode, 180)
   hs.setdevicestring(DeviceCode, "Night", 180)

Case "Up"
   hs.setdevicevalue(DeviceCode, hs.devicevalue(DeviceCode) + 5)
   hs.setdevicestring(DeviceCode, hs.devicevalue(DeviceCode) + 5, True)

   
Case "Down"
   hs.setdevicevalue(DeviceCode, hs.devicevalue(DeviceCode) - 5)
   hs.setdevicestring(DeviceCode, hs.devicevalue(DeviceCode) - 5, True)

   
Case "Set"
   hs.setdevicevalue(DeviceTherm, (hs.devicevalue(DeviceCode)))

End Select


   If (hs.devicevalue(devicecode) = 160) Then
        hs.SetDeviceValue(DeviceTherm, 16)
    End If
    If (hs.devicevalue(DeviceCode) = 165) Then
        hs.SetDeviceValue(DeviceTherm, 16.5)
    End If
    If (hs.devicevalue(DeviceCode) = 170) Then
        hs.SetDeviceValue(DeviceTherm, 17)
    End If
    If (hs.devicevalue(DeviceCode) = 175) Then
        hs.SetDeviceValue(DeviceTherm, 17.5)
    End If
    If (hs.devicevalue(DeviceCode) = 180) Then
        hs.SetDeviceValue(DeviceTherm, 18)
    End If
    If (hs.devicevalue(DeviceCode) = 185) Then
        hs.SetDeviceValue(DeviceTherm, 18.5)
    End If
    If (hs.devicevalue(DeviceCode) = 190) Then
        hs.SetDeviceValue(DeviceTherm, 19)
    End If
   If (hs.devicevalue(DeviceCode) = 195) Then
        hs.SetDeviceValue(DeviceTherm, 19.5)
    End If
   If (hs.devicevalue(DeviceCode) = 200) Then
        hs.SetDeviceValue(DeviceTherm, 20)
    End If
   If (hs.devicevalue(DeviceCode) = 205) Then
        hs.SetDeviceValue(DeviceTherm, 20.5)
    End If
   If (hs.devicevalue(DeviceCode) = 210) Then
        hs.SetDeviceValue(DeviceTherm, 21)
   End If
   If (hs.devicevalue(DeviceCode) = 215) Then
        hs.SetDeviceValue(DeviceTherm, 21.5)
    End If
   If (hs.devicevalue(DeviceCode) = 220) Then
        hs.SetDeviceValue(DeviceTherm, 22)
    End If
   If (hs.devicevalue(DeviceCode) = 225) Then
        hs.SetDeviceValue(DeviceTherm, 22.5)
    End If
   If (hs.devicevalue(DeviceCode) = 230) Then
        hs.SetDeviceValue(DeviceTherm, 23)
    End If
   If (hs.devicevalue(DeviceCode) = 235) Then
        hs.SetDeviceValue(DeviceTherm, 23.5)
    End If
   If (hs.devicevalue(DeviceCode) = 240) Then
        hs.SetDeviceValue(DeviceTherm, 24)
    End If
   If (hs.devicevalue(DeviceCode) = 245) Then
        hs.SetDeviceValue(DeviceTherm, 24.5)
    End If
   If (hs.devicevalue(DeviceCode) = 250) Then
        hs.SetDeviceValue(DeviceTherm, 25)
    End If

End Sub



Re: Opentherm gateway and script integration into Homeseer

Posted: Tue Dec 18, 2012 9:52 am
by Rutger
A little issue: my scriptname is "OT_H9_Device_Control.vb" so yours is "OT_O8_Device_Control.vb". That should be the trick.

Re: Opentherm gateway and script integration into Homeseer

Posted: Tue Dec 18, 2012 10:32 am
by raymonvdm
Rutger wrote:A little issue: my scriptname is "OT_H9_Device_Control.vb" so yours is "OT_O8_Device_Control.vb". That should be the trick.
Do you mean you renamed the BLB_OT_monitor_02.vb to OT_H9_Device_Control.vb or do you mean that the script which creates your device is called "OT_H9_Device_Control.vb

Re: Opentherm gateway and script integration into Homeseer

Posted: Tue Dec 18, 2012 10:56 am
by Rutger
the script which creates your device is called "OT_H9_Device_Control.vb"

Re: Opentherm gateway and script integration into Homeseer

Posted: Wed Dec 19, 2012 12:01 am
by raymonvdm
Tonight i made some time to take another shot on my thermostat

I have created an event which runs the following script once to create the device (OT_O8_Device_Control.vb)

Code: Select all


Sub Main(ByVal Parms As String)
' Created by    : Rutger Bockholts
' Version       : 1.0
' Date      : 15-12-2012
' This script will create a virtual device, status only, and add the control buttons Up, Down, Set, Night, and a dropdown list with degrees.
' Usable with "BLB_OT_monitor_02.vb" script for the OpenTherm Gateway
' DeviceTherm "H7" is the device "Kamerthermostaat-Tijdelijk" which is created by the "BLB_OT_monitor_02.vb" script.
' DeviceCode "H9" is the virtual device in this script.

Dim DeviceTherm As String = "O7"
Dim DeviceCode As String = "O8"

Dim DevExists As String
Try
   DevExists = hs.DeviceExists(Devicecode) 
   If DevExists = -1 Then 
        Dim devicenew As Integer
        Dim device As Scheduler.Classes.DeviceClass
        devicenew = hs.NewDeviceRef("OTGW Temperature")
        device = hs.GetDeviceByRef(devicenew)
      device.misc = &o10
      device.can_dim = "false"
      'device.iotype = IOTYPE_CONTROL
      device.dev_type_string = "Status Only"
      device.location = "Zolder"
      device.location2 = "CV"
        device.hc = left(DeviceCode,1) 
        device.dc = Mid(DeviceCode,2)
   
      ' Create Controlbuttons: Night, Up, Down, Set
      hs.devicebuttonadd(DeviceCode, "OT_O8_Device_Control.vb(""Main"", ""Night"")", "Night")
      hs.devicebuttonadd(DeviceCode, "OT_O8_Device_Control.vb(""Main"", ""Up"")", "Up")
      hs.devicebuttonadd(DeviceCode, "OT_O8_Device_Control.vb(""Main"", ""Down"")", "Down")
      hs.devicebuttonadd(DeviceCode, "OT_O8_Device_Control.vb(""Main"", ""Set"")", "Set")
      
      ' Create Controlbutton: Dropdownlist with degrees 
      hs.DeviceValuesAdd(DeviceCode, _
         "12,0" & chr(2) & "120" & chr(1) & _
         "12,5" & chr(2) & "125" & chr(1) & _
         "13,0" & chr(2) & "130" & chr(1) & _
         "13,5" & chr(2) & "135" & chr(1) & _
         "14,0" & chr(2) & "140" & chr(1) & _
         "14,5" & chr(2) & "145" & chr(1) & _
         "15,0" & chr(2) & "150" & chr(1) & _
         "15,5" & chr(2) & "155" & chr(1) & _
         "16,0" & chr(2) & "160" & chr(1) & _
         "16,5" & chr(2) & "165" & chr(1) & _
         "17,0" & chr(2) & "170" & chr(1) & _
         "17,5" & chr(2) & "175" & chr(1) & _
         "18,0" & chr(2) & "180" & chr(1) & _
         "18,5" & chr(2) & "185" & chr(1) & _
         "19,0" & chr(2) & "190" & chr(1) & _
         "19,5" & chr(2) & "195" & chr(1) & _
         "20,0" & chr(2) & "200" & chr(1) & _
         "20,5" & chr(2) & "205" & chr(1) & _
         "21,0" & chr(2) & "210" & chr(1) & _
         "21,5" & chr(2) & "215" & chr(1) & _
         "22,0" & chr(2) & "220" & chr(1) & _
         "22,5" & chr(2) & "225" & chr(1) & _
         "23,0" & chr(2) & "230" & chr(1) & _
         "23,5" & chr(2) & "235" & chr(1) & _
         "24,0" & chr(2) & "240" & chr(1) & _
         "24,5" & chr(2) & "245" & chr(1) & _
         "25,0" & chr(2) & "250" & chr(1) & _
         "Any Value" & chr(2) & "999", true)
      hs.writelog ("Info","New device is created")
   End If
Catch ex As Exception
      hs.writelog ("Info","No new device is created")
End Try

' Action for Controlbuttons
Select Case Parms
   Case "Night"
   hs.setdevicevalue(DeviceCode, 180)
   hs.setdevicestring(DeviceCode, "Night", 180)

Case "Up"
   hs.setdevicevalue(DeviceCode, hs.devicevalue(DeviceCode) + 5)
   hs.setdevicestring(DeviceCode, hs.devicevalue(DeviceCode) + 5, True)

   
Case "Down"
   hs.setdevicevalue(DeviceCode, hs.devicevalue(DeviceCode) - 5)
   hs.setdevicestring(DeviceCode, hs.devicevalue(DeviceCode) - 5, True)

   
Case "Set"
   hs.setdevicevalue(DeviceTherm, (hs.devicevalue(DeviceCode)))

End Select


   If (hs.devicevalue(devicecode) = 160) Then
        hs.SetDeviceValue(DeviceTherm, 16)
    End If
    If (hs.devicevalue(DeviceCode) = 165) Then
        hs.SetDeviceValue(DeviceTherm, 16.5)
    End If
    If (hs.devicevalue(DeviceCode) = 170) Then
        hs.SetDeviceValue(DeviceTherm, 17)
    End If
    If (hs.devicevalue(DeviceCode) = 175) Then
        hs.SetDeviceValue(DeviceTherm, 17.5)
    End If
    If (hs.devicevalue(DeviceCode) = 180) Then
        hs.SetDeviceValue(DeviceTherm, 18)
    End If
    If (hs.devicevalue(DeviceCode) = 185) Then
        hs.SetDeviceValue(DeviceTherm, 18.5)
    End If
    If (hs.devicevalue(DeviceCode) = 190) Then
        hs.SetDeviceValue(DeviceTherm, 19)
    End If
   If (hs.devicevalue(DeviceCode) = 195) Then
        hs.SetDeviceValue(DeviceTherm, 19.5)
    End If
   If (hs.devicevalue(DeviceCode) = 200) Then
        hs.SetDeviceValue(DeviceTherm, 20)
    End If
   If (hs.devicevalue(DeviceCode) = 205) Then
        hs.SetDeviceValue(DeviceTherm, 20.5)
    End If
   If (hs.devicevalue(DeviceCode) = 210) Then
        hs.SetDeviceValue(DeviceTherm, 21)
   End If
   If (hs.devicevalue(DeviceCode) = 215) Then
        hs.SetDeviceValue(DeviceTherm, 21.5)
    End If
   If (hs.devicevalue(DeviceCode) = 220) Then
        hs.SetDeviceValue(DeviceTherm, 22)
    End If
   If (hs.devicevalue(DeviceCode) = 225) Then
        hs.SetDeviceValue(DeviceTherm, 22.5)
    End If
   If (hs.devicevalue(DeviceCode) = 230) Then
        hs.SetDeviceValue(DeviceTherm, 23)
    End If
   If (hs.devicevalue(DeviceCode) = 235) Then
        hs.SetDeviceValue(DeviceTherm, 23.5)
    End If
   If (hs.devicevalue(DeviceCode) = 240) Then
        hs.SetDeviceValue(DeviceTherm, 24)
    End If
   If (hs.devicevalue(DeviceCode) = 245) Then
        hs.SetDeviceValue(DeviceTherm, 24.5)
    End If
   If (hs.devicevalue(DeviceCode) = 250) Then
        hs.SetDeviceValue(DeviceTherm, 25)
    End If

End Sub

But this will result in a issues with the gateway because of a setpoint of 2.4 when is should be 24 degrees (I`m not a HS / VB expert but already changed the dot with a comma in the script but this does not help) When something goes wrong during setting of the temperature the gateway or thermostat wil go into the max temp mode (35 degrees) which is hot







Image

Re: Opentherm gateway and script integration into Homeseer

Posted: Wed Dec 19, 2012 1:48 am
by blb
raymonvdm,

Devicevalues are integers

Re: Opentherm gateway and script integration into Homeseer

Posted: Thu Dec 27, 2012 2:18 pm
by raymonvdm
Today i noticed that the communication between HomeSeer and the OTG was broken again with the following errors

Code: Select all


27-12-2012 12:11:01 ~!~Event~!~Running script in background: BLB_OT_monitor_02.vb("Main","PS=1")
27-12-2012 12:11:01 ~!~Error~!~Scripting runtime error: System.Reflection.TargetInvocationException: Het doel van een aanroep heeft een uitzondering veroorzaakt. ---> System.InvalidCastException: De conversie van tekenreeks  naar type Boolean is ongeldig. ---> System.FormatException: De indeling van de invoertekenreeks is onjuist.   bij Microsoft.VisualBasic.CompilerServices.Conversions.ParseDouble(String Value, NumberFormatInfo NumberFormat)   bij Microsoft.VisualBasic.CompilerServices.Conversions.ToBoolean(String Value)   --- Einde van intern uitzonderingsstackpad ---   bij Microsoft.VisualBasic.CompilerServices.Conversions.ToBoolean(String Value)   bij scriptcode2.scriptcode2.Main(Object varParameters)   --- Einde van intern uitzonderingsstackpad ---   bij System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)   bij System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)   bij System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)   bij System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)   bij System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)   bij Scheduler.VsaScriptHost.Invoke(String ModuleName, String MethodName, Object[] Arguments)

Code: Select all


27-12-2012 12:15:31 	Event 	Running script in background: BLB_OT_monitor_02.vb("Main","PS=1")
27-12-2012 12:15:31 	Error 	Scripting runtime error: System.Reflection.TargetInvocationException: Het doel van een aanroep heeft een uitzondering veroorzaakt. --- System.InvalidCastException: De conversie van tekenreeks naar type Boolean is ongeldig. --- System.FormatException: De indeling van de invoertekenreeks is onjuist. bij Microsoft.VisualBasic.CompilerServices.Conversions.ParseDouble(String Value, NumberFormatInfo NumberFormat) bij Microsoft.VisualBasic.CompilerServices.Conversions.ToBoolean(String Value) --- Einde van intern uitzonderingsstackpad --- bij Microsoft.VisualBasic.CompilerServices.Conversions.ToBoolean(String Value) bij scriptcode2.scriptcode2.Main(Object varParameters) --- Einde van intern uitzonderingsstackpad --- bij System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) bij System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) bij System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) bij System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) bij System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) bij Scheduler.VsaScriptHost.Invoke(String ModuleName, String MethodName, Object[] Arguments)

After a restart of HomeSeer the problem is solved, but i`m not sure on what is causing the problem . . .

Is it possible that VisualBasic has crashed because of com4 errors because i`m also seeing this errors

Code: Select all


27-12-2012 12:15:01 ~!~Event~!~Running script in background: Jon00VDGraphing.vben("Main","*")
27-12-2012 12:15:01 ~!~Jon00_Uptime~!~Error at Subroutine main1 at block 2 (De conversie van tekenreeks  naar type Date is ongeldig.)
27-12-2012 12:15:01 ~!~Jon00_Uptime~!~Error at Subroutine main1 at block 3 (De conversie van tekenreeks  naar type Date is ongeldig.)
27-12-2012 12:15:01 ~!~Jon00_Uptime~!~Error at Subroutine main1 at block 4 (De indeling van de invoertekenreeks is onjuist.)
27-12-2012 12:15:01 ~!~Jon00_Uptime~!~Error at Subroutine main1 at block 5 (De indeling van de invoertekenreeks is onjuist.)
27-12-2012 12:15:01 ~!~Jon00_Uptime~!~Error at Subroutine main1 at block 2 (De conversie van tekenreeks  naar type Date is ongeldig.)
27-12-2012 12:15:01 ~!~Jon00_Uptime~!~Error at Subroutine main1 at block 3 (De conversie van tekenreeks  naar type Date is ongeldig.)
27-12-2012 12:15:01 ~!~Jon00_Uptime~!~Error at Subroutine main1 at block 4 (De indeling van de invoertekenreeks is onjuist.)
27-12-2012 12:15:01 ~!~Jon00_Uptime~!~Error at Subroutine main1 at block 5 (De indeling van de invoertekenreeks is onjuist.)
27-12-2012 12:15:01 ~!~Jon00_Uptime~!~Error at Subroutine main1 at block 2 (De conversie van tekenreeks  naar type Date is ongeldig.)
27-12-2012 12:15:01 ~!~Jon00_Uptime~!~Error at Subroutine main1 at block 3 (De conversie van tekenreeks  naar type Date is ongeldig.)
27-12-2012 12:15:01 ~!~Jon00_Uptime~!~Error at Subroutine main1 at block 4 (De indeling van de invoertekenreeks is onjuist.)
27-12-2012 12:15:01 ~!~Jon00_Uptime~!~Error at Subroutine main1 at block 5 (De indeling van de invoertekenreeks is onjuist.)
27-12-2012 12:15:01 ~!~Jon00_Uptime~!~Error at Subroutine main1 at block 2 (De conversie van tekenreeks  naar type Date is ongeldig.)
27-12-2012 12:15:01 ~!~Jon00_Uptime~!~Error at Subroutine main1 at block 3 (De conversie van tekenreeks  naar type Date is ongeldig.)
27-12-2012 12:15:01 ~!~Jon00_Uptime~!~Error at Subroutine main1 at block 4 (De indeling van de invoertekenreeks is onjuist.)
27-12-2012 12:15:01 ~!~Jon00_Uptime~!~Error at Subroutine main1 at block 5 (De indeling van de invoertekenreeks is onjuist.)
27-12-2012 12:15:01 ~!~Jon00_Uptime~!~Error at Subroutine main1 at block 2 (De conversie van tekenreeks  naar type Date is ongeldig.)
27-12-2012 12:15:01 ~!~Jon00_Uptime~!~Error at Subroutine main1 at block 3 (De conversie van tekenreeks  naar type Date is ongeldig.)
27-12-2012 12:15:01 ~!~Jon00_Uptime~!~Error at Subroutine main1 at block 4 (De indeling van de invoertekenreeks is onjuist.)
27-12-2012 12:15:01 ~!~Jon00_Uptime~!~Error at Subroutine main1 at block 5 (De indeling van de invoertekenreeks is onjuist.)
27-12-2012 12:15:01 ~!~Jon00_Uptime~!~Error at Subroutine main1 at block 2 (De conversie van tekenreeks  naar type Date is ongeldig.)
27-12-2012 12:15:01 ~!~Jon00_Uptime~!~Error at Subroutine main1 at block 3 (De conversie van tekenreeks  naar type Date is ongeldig.)
27-12-2012 12:15:01 ~!~Jon00_Uptime~!~Error at Subroutine main1 at block 4 (De indeling van de invoertekenreeks is onjuist.)
27-12-2012 12:15:01 ~!~Jon00_Uptime~!~Error at Subroutine main1 at block 5 (De indeling van de invoertekenreeks is onjuist.)
27-12-2012 12:15:01 ~!~Jon00_Uptime~!~Error at Subroutine main1 at block 2 (De conversie van tekenreeks  naar type Date is ongeldig.)
27-12-2012 12:15:01 ~!~Jon00_Uptime~!~Error at Subroutine main1 at block 3 (De conversie van tekenreeks  naar type Date is ongeldig.)
27-12-2012 12:15:01 ~!~Jon00_Uptime~!~Error at Subroutine main1 at block 4 (De indeling van de invoertekenreeks is onjuist.)
27-12-2012 12:15:01 ~!~Jon00_Uptime~!~Error at Subroutine main1 at block 5 (De indeling van de invoertekenreeks is onjuist.)
27-12-2012 12:15:02 ~!~Jon00_Uptime~!~Error at Subroutine main1 at block 2 (De conversie van tekenreeks  naar type Date is ongeldig.)
27-12-2012 12:15:02 ~!~Jon00_Uptime~!~Error at Subroutine main1 at block 3 (De conversie van tekenreeks  naar type Date is ongeldig.)
27-12-2012 12:15:02 ~!~Jon00_Uptime~!~Error at Subroutine main1 at block 4 (De indeling van de invoertekenreeks is onjuist.)
27-12-2012 12:15:02 ~!~Jon00_Uptime~!~Error at Subroutine main1 at block 5 (De indeling van de invoertekenreeks is onjuist.)
27-12-2012 12:15:02 ~!~Jon00_Uptime~!~Error at Subroutine main1 at block 2 (De conversie van tekenreeks  naar type Date is ongeldig.)
27-12-2012 12:15:02 ~!~Jon00_Uptime~!~Error at Subroutine main1 at block 3 (De conversie van tekenreeks  naar type Date is ongeldig.)
27-12-2012 12:15:02 ~!~Jon00_Uptime~!~Error at Subroutine main1 at block 4 (De indeling van de invoertekenreeks is onjuist.)
27-12-2012 12:15:02 ~!~Jon00_Uptime~!~Error at Subroutine main1 at block 5 (De indeling van de invoertekenreeks is onjuist.)
27-12-2012 12:15:02 ~!~Jon00_Uptime~!~Error at Subroutine main1 at block 2 (De conversie van tekenreeks  naar type Date is ongeldig.)
27-12-2012 12:15:02 ~!~Jon00_Uptime~!~Error at Subroutine main1 at block 3 (De conversie van tekenreeks  naar type Date is ongeldig.)
27-12-2012 12:15:02 ~!~Jon00_Uptime~!~Error at Subroutine main1 at block 4 (De indeling van de invoertekenreeks is onjuist.)
27-12-2012 12:15:02 ~!~Jon00_Uptime~!~Error at Subroutine main1 at block 5 (De indeling van de invoertekenreeks is onjuist.)
27-12-2012 12:15:02 ~!~Jon00_Uptime~!~Error at Subroutine main1 at block 2 (De conversie van tekenreeks  naar type Date is ongeldig.)
27-12-2012 12:15:02 ~!~Jon00_Uptime~!~Error at Subroutine main1 at block 3 (De conversie van tekenreeks  naar type Date is ongeldig.)
27-12-2012 12:15:02 ~!~Jon00_Uptime~!~Error at Subroutine main1 at block 4 (De indeling van de invoertekenreeks is onjuist.)
27-12-2012 12:15:02 ~!~Jon00_Uptime~!~Error at Subroutine main1 at block 5 (De indeling van de invoertekenreeks is onjuist.)
27-12-2012 12:15:02 ~!~Jon00_Uptime~!~Error at Subroutine main1 at block 2 (De conversie van tekenreeks  naar type Date is ongeldig.)
27-12-2012 12:15:02 ~!~Jon00_Uptime~!~Error at Subroutine main1 at block 3 (De conversie van tekenreeks  naar type Date is ongeldig.)
27-12-2012 12:15:02 ~!~Jon00_Uptime~!~Error at Subroutine main1 at block 4 (De indeling van de invoertekenreeks is onjuist.)
27-12-2012 12:15:02 ~!~Jon00_Uptime~!~Error at Subroutine main1 at block 5 (De indeling van de invoertekenreeks is onjuist.)
27-12-2012 12:15:02 ~!~Jon00_Uptime~!~Error at Subroutine main1 at block 2 (De conversie van tekenreeks  naar type Date is ongeldig.)
27-12-2012 12:15:02 ~!~Jon00_Uptime~!~Error at Subroutine main1 at block 3 (De conversie van tekenreeks  naar type Date is ongeldig.)
27-12-2012 12:15:02 ~!~Jon00_Uptime~!~Error at Subroutine main1 at block 4 (De indeling van de invoertekenreeks is onjuist.)
27-12-2012 12:15:02 ~!~Jon00_Uptime~!~Error at Subroutine main1 at block 5 (De indeling van de invoertekenreeks is onjuist.)
27-12-2012 12:15:02 ~!~Jon00_Uptime~!~Error at Subroutine main1 at block 2 (De conversie van tekenreeks  naar type Date is ongeldig.)
27-12-2012 12:15:02 ~!~Jon00_Uptime~!~Error at Subroutine main1 at block 3 (De conversie van tekenreeks  naar type Date is ongeldig.)
27-12-2012 12:15:02 ~!~Jon00_Uptime~!~Error at Subroutine main1 at block 4 (De indeling van de invoertekenreeks is onjuist.)
27-12-2012 12:15:02 ~!~Jon00_Uptime~!~Error at Subroutine main1 at block 5 (De indeling van de invoertekenreeks is onjuist.)
27-12-2012 12:15:02 ~!~Jon00_Uptime~!~Error at Subroutine main1 at block 2 (De conversie van tekenreeks  naar type Date is ongeldig.)
27-12-2012 12:15:02 ~!~Jon00_Uptime~!~Error at Subroutine main1 at block 3 (De conversie van tekenreeks  naar type Date is ongeldig.)
27-12-2012 12:15:02 ~!~Jon00_Uptime~!~Error at Subroutine main1 at block 4 (De indeling van de invoertekenreeks is onjuist.)
27-12-2012 12:15:02 ~!~Jon00_Uptime~!~Error at Subroutine main1 at block 5 (De indeling van de invoertekenreeks is onjuist.)
27-12-2012 12:15:02 ~!~Jon00_Uptime~!~Error at Subroutine main1 at block 2 (De conversie van tekenreeks  naar type Date is ongeldig.)
27-12-2012 12:15:02 ~!~Jon00_Uptime~!~Error at Subroutine main1 at block 3 (De conversie van tekenreeks  naar type Date is ongeldig.)
27-12-2012 12:15:02 ~!~Jon00_Uptime~!~Error at Subroutine main1 at block 4 (De indeling van de invoertekenreeks is onjuist.)
27-12-2012 12:15:02 ~!~Jon00_Uptime~!~Error at Subroutine main1 at block 5 (De indeling van de invoertekenreeks is onjuist.)