Opentherm gateway and script integration into Homeseer

Forum over Homeseer scripts (DUTCH forum)

Moderators: TANE, Ruud

Tozz
Member
Member
Posts: 95
Joined: Sun Oct 28, 2007 5:20 pm
Location: Netherlands

Re: Opentherm gateway and script integration into Homeseer

Post by Tozz »

Ik heb de issues in dit script gevonden. Het zit 'm niet zozeer in het script maar vooral in de config file. Het is sws. zaak dat je de laatste versie van de config file gebruikt uit de ZIP file in de 1e post in deze thread.

Echter, de config file is niet correct. De volgende 3 waarden:

Code: Select all

[Temperatures]
TemporaryTemperature1=
TemporaryTemperature2=
OutsideTemperature=
Moeten de dvRef waarde bevatten van de devices en niet de housecode + devicecode. Dus een numeriek getal en geen alfanumerieke waarde. Als je in HS3 een device edit zie je in de URL iets staan als:

http://localhost/deviceutility?ref=55&edit=1

In dat geval is "55" de dvRef waarde van je device, en dat is dus de waarde die je moet invullen. In mijn geval moest ik dus V7 vervangen door 75, V8 door 76 en mijn OutsideTemperature was in mijn geval device 55. Uiteraard zijn die nummers per installatie verschillende.

Wanneer de config file bepaalde parameters niet heeft of wanneer de parameters verkeerde waarden hebben (zoals een housecode+device ID i.p.v. een referentie nummer) geeft het script hele onduidelijke foutmeldingen. Mijn uiteindelijke probleem was dan ook dat ik een oude config file had en in de nieuwe config file (uit de ZIP) zijn die waarden onjuist
raymonvdm
Senior Member
Senior Member
Posts: 1153
Joined: Sun Dec 18, 2011 1:23 am

Re: Opentherm gateway and script integration into Homeseer

Post by raymonvdm »

Is there someone who can release a complete working package?

I`m still stuck on the following error code

Code: Select all


apr-06 11:11:50	 	Error	Compiling script C:\Program Files\HomeSeer HS3\scripts\BLB_OT_monitor_02.vb: Function 'CreateOTDevices' doesn't return a value on all code paths. A null reference exception could occur at run time when the result is used.
apr-06 11:11:50	 	Error	Compiling script C:\Program Files\HomeSeer HS3\scripts\BLB_OT_monitor_02.vb: Function 'CreateOTGWDevices' doesn't return a value on all code paths. A null reference exception could occur at run time when the result is used.
apr-06 11:11:50	 	Error	Compiling script C:\Program Files\HomeSeer HS3\scripts\BLB_OT_monitor_02.vb: Unused local variable: 'DevName00'.
apr-06 11:11:50	 	Error	Compiling script C:\Program Files\HomeSeer HS3\scripts\BLB_OT_monitor_02.vb: Variable 'Reply' is used before it has been assigned a value. A null reference exception could result at runtime.
apr-06 11:11:50	 	Error	Compiling script C:\Program Files\HomeSeer HS3\scripts\BLB_OT_monitor_02.vb: Local variable 'GWValue' is already declared in the current block.
apr-06 11:11:50	 	Error	Compiling script C:\Program Files\HomeSeer HS3\scripts\BLB_OT_monitor_02.vb: Namespace or type 'HomeSeerAPI' has already been imported.
apr-06 11:11:50	 	Error	Compiling script C:\Program Files\HomeSeer HS3\scripts\BLB_OT_monitor_02.vb: Namespace or type specified in the Imports 'System.Core' doesn't contain any public member or cannot be found. Make sure the namespace or the type is defined and contains at least one public member. Make sure the imported element name doesn't use any aliases.

Running HS3PRO on PC with Z-Wave / OpenTherm / Plugwise / RFXcom / MQTT / XAP400 / Logitech Media Server and Squeezelite on PI`s
yoja
Starting Member
Starting Member
Posts: 44
Joined: Wed Feb 24, 2010 12:00 pm

Re: Opentherm gateway and script integration into Homeseer

Post by yoja »

Hi raymondvdm,

I posted my version of the script http://www.domoticaforum.eu/viewtopic.p ... &start=315
It has some issues, the connection with the telnet client gets corrupted. I have not have time to get into this. But it works with HS3.

Maybe it works for you, and if not you can figure out the telnet problems ;-)

yoja
raymonvdm
Senior Member
Senior Member
Posts: 1153
Joined: Sun Dec 18, 2011 1:23 am

Re: Opentherm gateway and script integration into Homeseer

Post by raymonvdm »

I`m not using telnet so i cannot use your script although i tried to set it to comport.


I tried the original script but still without any success

Code: Select all

apr-15 18:30:33	 	Error	Compiling script C:\Program Files\HomeSeer HS3\scripts\BLB_OT_monitor_02.vb: Function 'CreateOTDevices' doesn't return a value on all code paths. A null reference exception could occur at run time when the result is used.
apr-15 18:30:33	 	Error	Compiling script C:\Program Files\HomeSeer HS3\scripts\BLB_OT_monitor_02.vb: Function 'CreateOTGWDevices' doesn't return a value on all code paths. A null reference exception could occur at run time when the result is used.
apr-15 18:30:33	 	Error	Compiling script C:\Program Files\HomeSeer HS3\scripts\BLB_OT_monitor_02.vb: Unused local variable: 'DevName00'.
apr-15 18:30:33	 	Error	Compiling script C:\Program Files\HomeSeer HS3\scripts\BLB_OT_monitor_02.vb: Variable 'Reply' is used before it has been assigned a value. A null reference exception could result at runtime.
apr-15 18:30:33	 	Error	Compiling script C:\Program Files\HomeSeer HS3\scripts\BLB_OT_monitor_02.vb: Variable 'GWString' is used before it has been assigned a value. A null reference exception could result at runtime.
apr-15 18:30:33	 	Error	Compiling script C:\Program Files\HomeSeer HS3\scripts\BLB_OT_monitor_02.vb: Variable 'GWValue' is used before it has been assigned a value. A null reference exception could result at runtime.
apr-15 18:30:33	 	Error	Compiling script C:\Program Files\HomeSeer HS3\scripts\BLB_OT_monitor_02.vb: Namespace or type 'HomeSeerAPI' has already been imported.
apr-15 18:30:33	 	Error	Compiling script C:\Program Files\HomeSeer HS3\scripts\BLB_OT_monitor_02.vb: Namespace or type specified in the Imports 'System.Core' doesn't contain any public member or cannot be found. Make sure the namespace or the type is defined and contains at least one public member. Make sure the imported element name doesn't use any aliases.
And this is my ini file

Code: Select all

[Startup]
Version=0.2m
Telnet=False
SerialControlInScript=TRUE
SerialPort=4
SerialPortConfig=9600,N,8,1
TCPAddress=172.31.0.170
TCPPort=20108
HouseCode=O
DevLocation=CV
DevLocationswitched=False
Debug=1

[Gateway]
FirstDC=1
Celcia20=False
LEDS=TBOC
ReferenceVoltage=3
DevLocation2=Zolder

[Temperatures]
TemporaryTemperature1=505
TemporaryTemperature2=506
OutsideTemperature=398
Day=19,8
Night=15,0
Cool=6,0

[OTPSCodes]
FirstDC=10
dev_type_string=Vaillant VHR-C NL 24-28C
DevLocation2=Zolder

[OTDatabase]
Path=C:\Program Files\HomeSeer HS3\data\OT\OT.mdb

[ScriptExchange]
TEST=TEST
I manually created the devices TemporaryTemperature1 and TemporaryTemperature1 but do i also need to create all the other devices by hand (I have a working HS2 setup so i can copy devices one by one)
Running HS3PRO on PC with Z-Wave / OpenTherm / Plugwise / RFXcom / MQTT / XAP400 / Logitech Media Server and Squeezelite on PI`s
raymonvdm
Senior Member
Senior Member
Posts: 1153
Joined: Sun Dec 18, 2011 1:23 am

Re: Opentherm gateway and script integration into Homeseer

Post by raymonvdm »

Did anyone manage to use an OpenTherm gateway in HS3 ?
Running HS3PRO on PC with Z-Wave / OpenTherm / Plugwise / RFXcom / MQTT / XAP400 / Logitech Media Server and Squeezelite on PI`s
raymonvdm
Senior Member
Senior Member
Posts: 1153
Joined: Sun Dec 18, 2011 1:23 am

Re: Opentherm gateway and script integration into Homeseer

Post by raymonvdm »

I`m still looking for a way to get this working in HS3, it is getting colder and my boiler needs to be fired up again :D
Running HS3PRO on PC with Z-Wave / OpenTherm / Plugwise / RFXcom / MQTT / XAP400 / Logitech Media Server and Squeezelite on PI`s
mo046
Member
Member
Posts: 186
Joined: Thu Nov 08, 2007 4:12 pm
Location: Netherlands

Re: Opentherm gateway and script integration into Homeseer

Post by mo046 »

Hi,

I have a working HS script. To be honest, I downloaded a HS3 OT script, but I don't know the source anymore. It is a modified version of the HS2 plugin from the opening post. I have attached this original HS script (OT_script_HS3.rar). All credits to the unknown author!
[edit] the "unknown" author was yoja, and the source is here: http://www.domoticaforum.eu/viewtopic.p ... 462#p74524

I experienced a lot of issues with the script. It uses the Telnet connection and it had a lot of timing problems. The data request from HS to the OTG interrupted the data flow in an uncontrolled manner and the wrong responses were evaluated by the script.
So I experimented (hence the extensive debugging lines in the script) and found a way to send a dummy request to prepair the OTG so that it will send the right response on the next request.

Furthermore there were some issues with type declaration (integer instead of float) and some other minor issues.

Install the contents of the attached OT_script_HS.rar in your Homeseer program folder and replace the code of BLB_OT_monitor.vb with my modified code:

Code: Select all

Imports System.Net
Imports System.Net.Sockets
Imports System.Text

Const INI_FILE As String = "hssi_BLB_OT_monitor.ini"        ' name ini file

Sub Main(ByVal varParameters)

   Dim Command As String = varParameters

   Dim RemoteIP				    As String  = hs.GetINISetting("Telnet", "TCPAddress", "", INI_FILE)
   Dim PortNumber				As String  = hs.GetINISetting("Telnet", "TCPPort", "", INI_FILE)
   Dim Debug					As Integer = hs.GetINISetting("Debug", "Debug", "", INI_FILE)
   
   Dim Reply As String

   ' start with a PS=1 command to stop the standard output of OT messages
   Reply = SendDummy("PS=1",RemoteIP,PortNumber,Debug) ' Just a dummy to clear the buffers
   Sleep(1000)
   Reply = SendMessage("PS=1",RemoteIP,PortNumber,Debug)

   If Reply <> "error" Then
	   If Command = "update"
			 If Debug > 0 Then hs.WriteLog("debugOTGW1","Main; Message Send: update - Now execute CreateTempDropDown")
			 CreateTempDropDown()
			 If Debug > 0 Then hs.WriteLog("debugOTGW1","Main; Message Send: update - Now execute PS_UpdateDevices")
			 PS_UpdateDevices(Reply,Debug)
			 If Debug > 0 Then hs.WriteLog("debugOTGW1","Main; Message Send: update - Now sleep 200 ms and execute PR_UpdateDevices")
			 Sleep(200)
			 PR_UpdateDevices(RemoteIP,PortNumber,Debug)
	   Else
		  hs.WriteLog("OTGW","Main; Message Send: " & Command)
		  Reply = SendMessage(Command,RemoteIP,PortNumber,Debug)
		  hs.WriteLog("OTGW","Main; Message Reply: " & Reply)
	   End If
   End If
   
   ' set gateway back to default output
   Reply = SendMessage("PS=0",RemoteIP,PortNumber,Debug)

End Sub 

Sub SetTempChanged(ByVal varParameters)
   '' This function is called when value of "Temperature Override" is changed
   
   Dim RemoteIP				    As String  = hs.GetINISetting("Telnet", "TCPAddress", "", INI_FILE)
   Dim PortNumber				As String  = hs.GetINISetting("Telnet", "TCPPort", "", INI_FILE)
   Dim Debug					As Integer = hs.GetINISetting("Debug", "Debug", "", INI_FILE)
   Dim Reply As String

   If Debug > 0 Then hs.WriteLog("debugOTGW1","SetTempChanged; Parameters: " & Cstr(varParameters(2)))
   
   If varParameters(2) = 0 Then
     hs.WriteLog("OTGW","SetTempChanged; Disabling Temperature Override")
     Reply = SendMessage("TT=0",RemoteIP,PortNumber,Debug)
     hs.WriteLog("OTGW","SetTempChanged; Reply: " & Reply)	
	 hs.SetDeviceString(varParameters(0),"<img src='images/Homeseer/ui/5-x-5_trans_spacer.gif'>" & _
				 hs.DeviceVSP_GetStatus(varParameters(0), varParameters(2), 1), False)
   Else
      Dim dvRef
 
      dvRef = hs.GetDeviceRef("OT_TempOverrideMode")
      If dvRef > 0 then
	      Dim value = hs.DeviceValue(dvRef)
		  If value = 0 Then
             Reply = SendMessage("TT=" & Cstr(varParameters(2)) & ".00",RemoteIP,PortNumber,Debug)
             hs.WriteLog("OTGW","SetTempChanged; Temporary Override. Reply: " & Reply)
		     hs.SetDeviceString(varParameters(0),"<img src='images/Homeseer/ui/5-x-5_trans_spacer.gif'>" & _
				 "Temporary Override = " &  hs.DeviceVSP_GetStatus(varParameters(0), varParameters(2), 1), False)	 
		  Else
             Reply = SendMessage("TC=" & Cstr(varParameters(2)) & ".00",RemoteIP,PortNumber,Debug)
             hs.WriteLog("OTGW","SetTempChanged; Constant Override. Reply: " & Reply)
		     hs.SetDeviceString(varParameters(0),"<img src='images/Homeseer/ui/5-x-5_trans_spacer.gif'>" & _
				 "Constant Override = " &  hs.DeviceVSP_GetStatus(varParameters(0), varParameters(2), 1), False)
		  End If
   
      End If  
   End If
   
End Sub

Sub SetTempOverrideMode(ByVal varParameters)
   '' This function is called when value of "Temperature Override Mode" is changed
   
   Dim RemoteIP				    As String  = hs.GetINISetting("Telnet", "TCPAddress", "", INI_FILE)
   Dim PortNumber				As String  = hs.GetINISetting("Telnet", "TCPPort", "", INI_FILE)
   Dim Debug					As Integer = hs.GetINISetting("Debug", "Debug", "", INI_FILE)
   Dim Reply As String

   If Debug > 0 Then hs.WriteLog("debugOTGW1","SetTempOverrideMode; Parameters: " & Cstr(varParameters(2)))
   
   Dim dvRef
 
   dvRef = hs.GetDeviceRef("OT_TempDropDown")
   If dvRef > 0 then
      Dim value = hs.DeviceValue(dvRef)
	  If value > 0 Then
	     If varParameters(2) = 0
	        Reply = SendMessage("TT=" & Cstr(value) & ".00",RemoteIP,PortNumber,Debug)
            hs.WriteLog("OTGW","SetTempOverrideMode; Temporary Override. Reply: " & Reply)
		    hs.SetDeviceString(dvRef,"<img src='images/Homeseer/ui/5-x-5_trans_spacer.gif'>" & _
				 "Temporary Override = " &  hs.DeviceVSP_GetStatus(dvRef, value, 1), False)	
	     Else
		    Reply = SendMessage("TC=" & Cstr(value) & ".00",RemoteIP,PortNumber,Debug)
            hs.WriteLog("OTGW","SetTempOverrideMode; Constant Override. Reply: " & Reply)
			hs.SetDeviceString(dvRef,"<img src='images/Homeseer/ui/5-x-5_trans_spacer.gif'>" & _
				 "Constant Override = " &  hs.DeviceVSP_GetStatus(dvRef, value, 1), False)	
		 End If
	  End If
   End If
   
   hs.SetDeviceString(varParameters(0), "<img src='images/Homeseer/ui/5-x-5_trans_spacer.gif'>" & _
      hs.DeviceVSP_GetStatus(varParameters(0), varParameters(2), 1), False)
   
End Sub

Private Function SendDummy(Message,RemoteIP,PortNumber,Debug) as String
	
	Dim Reply as String
	Dim Counter as Integer = 1
	Dim CounterMax as Integer = 30
	
	If Debug > 0 Then hs.WriteLog("debugOTGW1","SendDummy; Message: " & Message)

	Dim Client As New TcpClient()
	Try
		Client.Connect(IPAddress.Parse(RemoteIP), PortNumber)
		Dim NetStream As NetworkStream = Client.GetStream()
		' Send message
		SendString(NetStream, message & vbCrLf)
		' Receive reply
		Sleep(500)
		Reply = CleanReply(ReadString(Client),Debug)
		If Debug > 0 Then hs.WriteLog("debugOTGW1","SendDummy; CleanReply: " & Reply)
		Client.Close()
	Catch ex As Exception
	    hs.WriteLog("Error","SendDummy; OTGW: " & ex.Message)
		Reply = "error"
		Client.Close()
	End Try
		
	Return Reply
End Function 

Private Function SendMessage(Message,RemoteIP,PortNumber,Debug) as String
	
	Dim Reply as String
	Dim Counter as Integer = 1
	Dim CounterMax as Integer = 30
	
	If Debug > 0 Then hs.WriteLog("debugOTGW1","SendMessage; Message: " & Message)

	Dim Client As New TcpClient()
	Try
		Client.Connect(IPAddress.Parse(RemoteIP), PortNumber)
		Dim NetStream As NetworkStream = Client.GetStream()
		' Send message
		SendString(NetStream, message & vbCrLf)
		' Receive reply
		' Sleep(200)
		Reply = CleanReply(ReadString(Client),Debug)
		If Debug > 0 Then hs.WriteLog("debugOTGW1","SendMessage; CleanReply: " & Reply)
			
		' when the request comes between the thermostat request and the boiler response, it receives the wrong reply and we need to look at the next message
		Do While Not Left(Reply,2) = Left(Message,2) And Counter < CounterMax ' When a command is accepted by the gateway, it should respond with the two letters of the command code
		   Counter += 1
		   If Debug > 1 Then hs.WriteLog("debugOTGW2","SendMessage; Looking for a valid reply to " & Message & " (attempt " & Counter & ")")
		   Reply = ReadString(Client)
		   If Debug > 1 Then hs.WriteLog("debugOTGW2","SendMessage; This is the reply for " & Message & ": " & Reply)
		   If Not Left(Reply,2) = Left(Message,2) And Counter = CounterMax Then ' to avoid indefinite loop, the loop will end when the counter limit CounterMax has been reached
			  hs.WriteLog("OTGW","SendMessage; Error! No valid response to message " & Message)
			  Reply = "error"
		   End If
		Loop
		
		' only for PS=1 we need to evaluate the next message with the Print Summary information
		Counter = 0
		Do While Message = "PS=1" And Not Reply = "error" And Not Left(Reply,2) = "00" And Counter < CounterMax-1 ' a valid response to the Print Summary (PS) starts with Status (MsgID=0) which starts with "00" by default
		   Counter += 1
		   If Debug > 1 Then hs.WriteLog("debugOTGW2","SendMessage; Looking for a valid Print Summary reply (attempt " & Counter & ")")
		   If Debug > 1 Then hs.WriteLog("debugOTGW2","SendMessage; This is the length of the reply: " & Len(Reply))
		   If Len(Reply) > 7 And Left(Reply,5) = "PS: 1" Then ' sometimes the Print Summary information is already attached to "PS: 1 " in the reply (due to timing issues); we just need to cut off the "PS: 1 ", that's it!
			  Reply = Right(Reply,Len(Reply)-7)
		   Else
			  Reply = ReadString(Client)
		   End If
		   If Debug > 1 Then hs.WriteLog("debugOTGW2","SendMessage; This is the Print Summary reply: " & Reply)
		   If Not Left(Reply,2) = "00" And Counter = CounterMax Then ' to avoid indefinite loop, the loop will end when the counter limit CounterMax has been reached
			  hs.WriteLog("OTGW","SendMessage; Error! No valid Print Summary reply")
			  Reply = "error"
		   End If
		Loop
		
		' If Message = "PS=1" Then
		'    ' second message is interesting
		'    If Debug > 1 Then hs.WriteLog("debugOTGW2","SendMessage; Looking for a valid reply to PS=1 ....")
		'    Reply = ReadString(Client)
		'    If Debug > 1 Then hs.WriteLog("debugOTGW2","SendMessage; This is the reply for PS=1: " & Reply)
		'    If Not Left(Reply,2) = "00" Then 
		'    'If Reply = "PS: 1" Then 		' when the request comes between the thermostat request and the boiler response, it receives the wrong reply and we need to look at the third message
		' 		If Debug > 1 Then hs.WriteLog("debugOTGW2","SendMessage; Oops .... reply to PS=1 incorrect!!!")
		' 		Reply = ReadString(Client)
		' 		hs.WriteLog("OTGW","SendMessage; Status third line: " & Reply)
		'    End If

		' Disconnect
		Client.Close()
	Catch ex As Exception
	    hs.WriteLog("Error","SendMessage; OTGW: " & ex.Message)
		Reply = "error"
		Client.Close()
	End Try
		
	Return Reply
End Function 

Private Function ReadString(ByVal Client As System.Net.Sockets.TcpClient) As String
	Dim Stream As NetworkStream = Client.GetStream
	Dim Buffersize As Integer = Client.ReceiveBufferSize
	Dim Data(Buffersize -1) As Byte
	If Stream.CanTimeout Then Stream.ReadTimeout = 1000 * 10 '15
	Dim BytesRead As Integer = Stream.Read(Data, 0, Buffersize)
	Return Encoding.ASCII.GetString(Data, 0, BytesRead)
End Function
 
Private Function SendString(ByVal Stream As NetworkStream, ByVal Data As String) As Boolean
	Dim Bytes As [Byte]() = Encoding.ASCII.GetBytes(Data)
	If Stream.CanTimeout Then Stream.WriteTimeout = 1000 * 10 '5
	Stream.Write(Bytes, 0, Bytes.Length)
	Return True
End Function  

Private Function CleanReply(Reply,Debug) as String
	Dim xx = InStr(Reply,"Error")					' check if Reply contains and Error (start from "Error xx" direct after reply on PS=1 command)
	If xx = 1
		If Debug > 1 Then hs.WriteLog("debugOTGW2","CleanReply (xx = 1); Response from Serial Port: " & Reply)
		Reply = Right(Reply,(Reply.Length)-9)		' in that case strip Reply
	Else If xx > 1
		If Debug > 1 Then hs.WriteLog("debugOTGW2","CleanReply (xx > 1); Response from Serial Port: " & Reply)
		Reply = Left(Reply,xx-1)					' in that case strip Reply
	End If
	Return Reply
End Function 

Private Function PR_UpdateDevices(RemoteIP,PortNumber,Debug)

	Dim PR_command() As String = {"T","R","M","V","O","W","L"}
	
	Dim GWValue As Double
	Dim GWDevice, GWImage, GWString, message, OTReplyType As String
    Dim Reply, OTReplyValue As String
		
	For i As Byte = 0 To PR_command.GetUpperBound(0)
	    GWValue = 0
		GWImage = "/images/HomeSeer/status/custom.gif"
		message  = "PR=" & PR_command(i)
		Reply = SendMessage(Message,RemoteIP,PortNumber,Debug)
		If Debug > 0 Then hs.WriteLog("debugOTGW1", "PR_UpdateDevices; Reply: " & Reply)
		
		If Reply <> "error" Then 
			OTReplyType = Mid(Reply,5,1)
			OTReplyValue = Stringitem(Reply, 2 , "=")
			Select Case OTReplyType
				Case "T"
					'' Tweaks. Reports the state of the ignore transitions and override in high byte settings.
					GWDevice = "Gateway Type"
					GWString = "Normal"
					If OTReplyValue = "1" Then GWString = "Celcia20"
				Case "R"
					'' The state of the automatic Remeha thermostat detection.
					GWDevice = "Thermostat Type"
					GWString = "Default"
					If Left(OTReplyValue,1) = "I" Then GWString = "Remeha iSense"
					If Left(OTReplyValue,1) = "C" Then GWString = "Remeha Celcia20"
					If Left(OTReplyValue,1) = "R" Then GWString = "Remeha thermostat"
                Case "M"
					'' Gateway mode. G=Gateway, M=Monitor.
					GWDevice = "Mode"
					GWValue = 0
					GWString = "Monitor"
					If asc(OTReplyValue) = 71 Then
						GWValue  = 1
						GWString = "Gateway"
					End If
				Case "V"
					'' Report the reference voltage setting
					GWDevice = "Voltage Reference"
					GWValue  = Val(OTReplyValue)
					GWString = OTReplyValue & " V"
				Case "O"
					'' Report the setpoint override value
					GWDevice = "Setpoint Override"
					GWValue = 0
					GWImage = "/images/OpenTherm/off.gif"
					GWstring = "No"
					If Left(OTReplyValue,1) <> "N"
						GWValue = 1
						GWImage = "/images/OpenTherm/on.gif"
						GWString = "Yes: " & mid(OTReplyValue,1,5) & " °C"
					Else
						Dim dvRef = hs.GetDeviceRef("OT_TempDropDown")
						If dvRef > 0 then
						   If hs.DeviceValue(dvRef) > 0 Then
							  hs.SetDeviceValueByRef(dvRef,0,False)
							  hs.SetDeviceString(dvRef,"<img src='images/Homeseer/ui/5-x-5_trans_spacer.gif'>" & _
								 "Thermostat Control (Set by thermostat)", False)
						   End If
						End If
					End If
				Case "W"
					'' Report the domestic hot water setting
					GWDevice = "DHW Enabled"
					GWValue  = 0
					GWImage = "/images/OpenTherm/off.gif"
					GWstring = "Disabled"
					If Left(OTReplyValue,1) = "A"
						GWValue = 1
						GWImage = "/images/OpenTherm/on.gif"
						GWString = "Enabled"
					End If
				Case "L"
					'' Configured functions for all 6 LEDS. The response consists of 6 letters representing the functions of LED A through LED F.
					GWDevice = "LEDs"
					GWValue  = 1
					GWString = OTReplyValue 
				Case Else
					hs.WriteLog("OTGW", "PR_UpdateDevices; not recognized reply: " & OTReplyType)
					hs.WriteLog("OTGW", "PR_UpdateDevices; Message: " & message)
					hs.WriteLog("OTGW", "PR_UpdateDevices; Reply: " & Reply)
					hs.WriteLog("OTGW", "PR_UpdateDevices; OTReplyType: " & OTReplyType)
					hs.WriteLog("OTGW", "PR_UpdateDevices; OTReplyValue: " & OTReplyValue)
			End Select
			
			PR_SetDeviceValue(GWDevice, GWString, GWValue, GWImage)
			
			If Debug > 0 Then hs.WriteLog("debugOTGW1","PR_UpdateDevices; Reply on PRC command: " & OTReplyType & ": " & OTReplyValue)
		End If
	Next

End Function

Private Function PS_UpdateDevices(Reply,Debug)

   Dim GWValue as Double
   Dim GWDevice, GWImage, GWString as String
   Dim MyArray(), StatusArray() As String
   
   MyArray = Split(Reply,",")
   For i As Byte = 0 To MyArray.GetUpperBound(0)
	   GWValue = 0
	   GWImage = "/images/HomeSeer/status/custom.gif"
	   
	   Select Case i
	      Case 0
		     '' Status (MsgID=0) - Printed as two 8-bit bitfields
			 GWDevice = "Status"
			 GWstring = MyArray(i)
			 PS_SetDeviceValue(GWDevice, GWString, GWValue, GWImage)
			 
			 StatusArray = Split(GWstring,"/")
			 'StatusArray(0) is Master Status (Thermostat)
			 
			 GWValue = Val(Mid(StatusArray(0),8,1))
			 GWDevice = "CH Enable"
			 GWstring = Mid(StatusArray(0),8,1)
			 PS_SetDeviceValue(GWDevice, GWString, GWValue, GWImage)
			 
			 GWValue = Val(Mid(StatusArray(0),7,1))
			 GWDevice = "DHW Enable"
			 GWstring = Mid(StatusArray(0),7,1)
			 PS_SetDeviceValue(GWDevice, GWString, GWValue, GWImage)
			 
			 'StatusArray(1) is Slave Status (Boiler)
			 
			 GWValue = Val(Mid(StatusArray(1),8,1))
			 GWDevice = "Fault Indication"
			 GWstring = Mid(StatusArray(1),8,1)
			 PS_SetDeviceValue(GWDevice, GWString, GWValue, GWImage)
			 
			 GWValue = Val(Mid(StatusArray(1),7,1))
			 GWDevice = "CH Mode"
			 GWstring = Mid(StatusArray(1),7,1)
			 PS_SetDeviceValue(GWDevice, GWString, GWValue, GWImage)
			 
			 GWValue = Val(Mid(StatusArray(1),6,1))
			 GWDevice = "DHW Mode"
			 GWstring = Mid(StatusArray(1),6,1)
			 PS_SetDeviceValue(GWDevice, GWString, GWValue, GWImage)
			 
			 GWValue = Val(Mid(StatusArray(1),5,1))
			 GWDevice = "Flame Status"
			 GWstring = Mid(StatusArray(1),5,1)
			 PS_SetDeviceValue(GWDevice, GWString, GWValue, GWImage)
			 
			 GWValue = Val(Mid(StatusArray(1),2,1))
			 GWDevice = "Diagnostic Indication"
			 GWstring = Mid(StatusArray(1),2,1)
			 PS_SetDeviceValue(GWDevice, GWString, GWValue, GWImage)
		  Case 1
		     '' Control setpoint (MsgID=1) - Printed as a floating point value
		  Case 2
		     '' Remote parameter flags (MsgID= 6) - Printed as two 8-bit bitfields												' DEZE WORDT WEL GEBRUIKT. UITCODEREN!
		  Case 3
		     '' Maximum relative modulation level (MsgID=14) - Printed as a floating point value
			 GWValue = Val(MyArray(i))
			 GWDevice = "Maximum relative modulation level"
			 GWstring = MyArray(i) & " %"
			 PS_SetDeviceValue(GWDevice, GWString, GWValue, GWImage)
		  Case 4
		     '' Boiler capacity and modulation limits (MsgID=15) - Printed as two bytes
		  Case 5
		     '' Room Setpoint (MsgID=16) - Printed as a floating point value
			 GWValue = Val(MyArray(i))
			 GWDevice = "Room Setpoint"
			 GWstring = MyArray(i) & " °C"
			 PS_SetDeviceValue(GWDevice, GWString, GWValue, GWImage)
		  Case 6
		     '' Relative modulation level (MsgID=17) - Printed as a floating point value
			 GWValue = Val(MyArray(i))
			 GWDevice = "Relative modulation level"
			 GWstring = MyArray(i) & " %"
			 PS_SetDeviceValue(GWDevice, GWString, GWValue, GWImage)
		  Case 7
		     '' CH water pressure (MsgID=18) - Printed as a floating point value
			 GWValue = Val(MyArray(i))
			 GWDevice = "CH water pressure"
			 GWstring = MyArray(i)
			 PS_SetDeviceValue(GWDevice, GWString, GWValue, GWImage)
		  Case 8
		     '' Room temperature (MsgID=24) - Printed as a floating point value
			 GWValue = Val(MyArray(i))
			 GWDevice = "Room temperature"
			 GWstring = MyArray(i) & " °C"
			 PS_SetDeviceValue(GWDevice, GWString, GWValue, GWImage)
		  Case 9
		     '' Boiler water temperature (MsgID=25) - Printed as a floating point value
	         GWValue = Val(MyArray(i))
			 GWDevice = "Boiler water temperature"
			 GWstring = MyArray(i) & " °C"
			 PS_SetDeviceValue(GWDevice, GWString, GWValue, GWImage)
		  Case 10
		     '' DHW temperature (MsgID=26) - Printed as a floating point value
	         GWValue = Val(MyArray(i))
			 GWDevice = "DHW temperature"
			 GWstring = MyArray(i) & " °C"
			 PS_SetDeviceValue(GWDevice, GWString, GWValue, GWImage)
		  Case 11
		     '' Outside temperature (MsgID=27) - Printed as a floating point value
			 GWValue = Val(MyArray(i))
			 GWDevice = "Outside temperature"
			 GWstring = MyArray(i) & " °C"
			 PS_SetDeviceValue(GWDevice, GWString, GWValue, GWImage)
		  Case 12
		     '' Return water temperature (MsgID=28) - Printed as a floating point value
			 GWValue = Val(MyArray(i))
			 GWDevice = "Return water temperature"
			 GWstring = MyArray(i) & " °C"
			 PS_SetDeviceValue(GWDevice, GWString, GWValue, GWImage)
		  Case 13
		     '' DHW setpoint boundaries (MsgID=48) - Printed as two bytes												' DEZE WORDT WEL GEBRUIKT. UITCODEREN!
		  Case 14
		     '' Max CH setpoint boundaries (MsgID=49) - Printed as two bytes
		  Case 15
		     '' DHW setpoint (MsgID=56) - Printed as a floating point value
			 GWValue = Val(MyArray(i))
			 GWDevice = "DHW setpoint"
			 GWstring = MyArray(i) & " °C"
			 PS_SetDeviceValue(GWDevice, GWString, GWValue, GWImage)
		  Case 16
		     '' Max CH water setpoint (MsgID=57) - Printed as a floating point value
			 GWValue = Val(MyArray(i))
			 GWDevice = "Max CH water setpoint"
			 GWstring = MyArray(i) & " °C"
			 PS_SetDeviceValue(GWDevice, GWString, GWValue, GWImage)
		  Case 17
		     '' Burner starts (MsgID=116) - Printed as a decimal value
			 GWValue = Val(MyArray(i))
			 GWDevice = "Burner starts"
			 GWstring = MyArray(i)
			 PS_SetDeviceValue(GWDevice, GWString, GWValue, GWImage)
		  Case 18
		     '' CH pump starts (MsgID=117) - Printed as a decimal value
			 GWValue = Val(MyArray(i))
			 GWDevice = "CH pump starts"
			 GWstring = MyArray(i)
			 PS_SetDeviceValue(GWDevice, GWString, GWValue, GWImage)
		  Case 19
		     '' DHW pump/valve starts (MsgID=118) - Printed as a decimal value
			 GWValue = Val(MyArray(i))
			 GWDevice = "DHW pump/valve starts"
			 GWstring = MyArray(i)
			 PS_SetDeviceValue(GWDevice, GWString, GWValue, GWImage)
		  Case 20
		     '' DHW burner starts (MsgID=119) - Printed as a decimal value
			 GWValue = Val(MyArray(i))
			 GWDevice = "DHW burner starts"
			 GWstring = MyArray(i)
			 PS_SetDeviceValue(GWDevice, GWString, GWValue, GWImage)
		  Case 21
		     '' Burner operation hours (MsgID=120) - Printed as a decimal value
			 GWValue = Val(MyArray(i))
			 GWDevice = "Burner operation hours"
			 GWstring = MyArray(i) & " h"
			 PS_SetDeviceValue(GWDevice, GWString, GWValue, GWImage)
		  Case 22
		     '' CH pump operation hours (MsgID=121) - Printed as a decimal value
			 GWValue = Val(MyArray(i))
			 GWDevice = "CH pump operation hours"
			 GWstring = MyArray(i) & " h"
			 PS_SetDeviceValue(GWDevice, GWString, GWValue, GWImage)
		  Case 23
		     '' DHW pump/valve operation hours (MsgID=122) - Printed as a decimal value
			 GWValue = Val(MyArray(i))
			 GWDevice = "DHW pump/valve operation hours"
			 GWstring = MyArray(i) & " h"
			 PS_SetDeviceValue(GWDevice, GWString, GWValue, GWImage)
		  Case 24
		     '' DHW burner operation hours (MsgID=123) - Printed as a decimal value
			 GWValue = Val(MyArray(i))
			 GWDevice = "DHW burner operation hours"
			 GWstring = MyArray(i) & " h"
			 PS_SetDeviceValue(GWDevice, GWString, GWValue, GWImage)
		  
	   End Select
	   
   Next

End Function

Private Function Stringitem(ByVal Str As String, ByVal Index As Integer, Byval Sep As String) As String
   Try
      Dim Result() As String = System.Text.RegularExpressions.Regex.Split(Str, System.Text.RegularExpressions.Regex.Escape(Sep))
      Return Result(Index-1)
   Catch
      Return ""
   End Try
End Function

Private Sub PR_SetDeviceValue(dev_name As String, dev_string As String, dev_value As Double, dev_image As String)

	Dim dvRef

    dvRef = hs.GetDeviceRef("OT_PR_" & dev_name)
    if dvRef > 0 then 
	   If Not hs.DeviceString(dvRef).Equals("<img src='" & dev_image & "'> " & dev_string) Then			' only set when DeviceString has changed
	      hs.SetDeviceValueByRef(dvRef, dev_value , False)
	      hs.SetDeviceString(dvRef, "<img src='" & dev_image & "'> " & dev_string, True)
	   End If
	Else
	   Dim dv As Scheduler.Classes.DeviceClass = Nothing

	   dv = hs.NewDeviceEx(dev_name)
	   dv.Location(hs) = hs.GetINISetting("HS", "Room", "", INI_FILE)
	   dv.Location2(hs) = hs.GetINISetting("HS", "Floor", "", INI_FILE)
	   dv.Code(hs) = "OT_PR_" & dev_name
	   dv.MISC_Set(hs, &H10) ' status only
	   dv.Image(hs) = "images\OpenTherm\OT.png"
	   hs.SetDeviceValueByRef(dv.Ref(hs), dev_value , False)
	   hs.SetDeviceString(dv.Ref(hs), "<img src='" & dev_image & "'> " & dev_string, True)
	   
	   If dev_name = "Gateway Type" Then
	      dv.Relationship(hs) = Enums.eRelationship.Parent_Root
	   Else
	      Dim rdvRef
		  Dim rdv As Scheduler.Classes.DeviceClass
		  
		  rdvRef = hs.GetDeviceRef("OT_PR_Gateway Type")
		  If rdvRef > 0 then
		     rdv = hs.GetDeviceByRef(rdvRef)
	         If rdv IsNot Nothing Then 
			    rdv.AssociatedDevice_Add(hs, dv.Ref(hs))
			    dv.Relationship(hs) = Enums.eRelationship.Child
		     End If
		  End If
	   End If

	End If

End Sub

Private Sub PS_SetDeviceValue(dev_name As String, dev_string As String, dev_value as Double, dev_image As String)

	Dim dvRef

    dvRef = hs.GetDeviceRef("OT_PS_" & dev_name)
    if dvRef > 0 then
	   If Not hs.DeviceString(dvRef).Equals("<img src='" & dev_image & "'> " & dev_string) Then			' only set when DeviceString has changed
	      hs.SetDeviceValueByRef(dvRef, dev_value , False)
	      hs.SetDeviceString(dvRef, "<img src='" & dev_image & "'> " & dev_string, True)
	   End If
	Else
	   Dim dv As Scheduler.Classes.DeviceClass = Nothing
	   
	   dv = hs.NewDeviceEx(dev_name)
	   dv.Location(hs) = hs.GetINISetting("HS", "Room", "", INI_FILE)
	   dv.Location2(hs) = hs.GetINISetting("HS", "Floor", "", INI_FILE)
	   dv.Code(hs) = "OT_PS_" & dev_name
	   dv.MISC_Set(hs, &H10) ' status only
	   dv.Image(hs) = "images\OpenTherm\OT.png"
	   hs.SetDeviceValueByRef(dv.Ref(hs), dev_value , False)
	   hs.SetDeviceString(dv.Ref(hs), "<img src='" & dev_image & "'> " & dev_string, True)
	   
	   If dev_name = "Status" Then
	      dv.Relationship(hs) = Enums.eRelationship.Parent_Root
		  dv.MISC_Set(hs, &H20) ' hide device from view
	   Else
	      Dim rdvRef
		  Dim rdv As Scheduler.Classes.DeviceClass
		  
		  rdvRef = hs.GetDeviceRef("OT_PS_Status")
		  If rdvRef > 0 then
		     rdv = hs.GetDeviceByRef(rdvRef)
	         If rdv IsNot Nothing Then 
			    rdv.AssociatedDevice_Add(hs, dv.Ref(hs))
			    dv.Relationship(hs) = Enums.eRelationship.Child
		     End If
		  End If
	   End If

	End If

End Sub

Private Sub CreateTempDropDown()

    Dim dvRef
	Dim dvRef2
	Dim dv As Scheduler.Classes.DeviceClass = Nothing
	Dim dv2 As Scheduler.Classes.DeviceClass = Nothing
    Dim Pair As VSPair
		
    dvRef = hs.GetDeviceRef("OT_TempDropDown")
    if dvRef <= 0 then 
       Dim DT As New DeviceTypeInfo

	   dv = hs.NewDeviceEx("Temperature Override")
	   dv.Location(hs) = hs.GetINISetting("HS", "Room", "", INI_FILE)
	   dv.Location2(hs) = hs.GetINISetting("HS", "Floor", "", INI_FILE)
	   dv.Code(hs) = "OT_TempDropDown"
	   dv.Image(hs) = "images\OpenTherm\OT.png"
	   dv.Relationship(hs) = Enums.eRelationship.Parent_Root
	   dv.MISC_Set(hs, Enums.dvMISC.SHOW_VALUES) 'This is &H100
	   dv.MISC_Clear(hs, Enums.dvMISC.STATUS_ONLY) 'This is &H10
	   dv.ScriptName(hs) = "BLB_OT_monitor.vb"
	   dv.ScriptFunc(hs) = "SetTempChanged"

	   DT.Device_API = DeviceTypeInfo.eDeviceAPI.Script
       DT.Device_Type = DeviceTypeInfo.eDeviceType_Script.Run_On_Value_Change

       dv.DeviceType_Set(hs) = DT
	   
	   Pair = New VSPair(HomeSeerAPI.ePairStatusControl.Both)
       Pair.PairType = VSVGPairType.SingleValue
	   Pair.Value = 0
	   Pair.Render =  Enums.CAPIControlType.Values
	   Pair.Status = "Thermostat Control"
	   hs.DeviceVSP_AddPair(dv.Ref(hs), Pair)
	   
       For index As Integer = 10 To 25
            Pair = New VSPair(HomeSeerAPI.ePairStatusControl.Both)
            Pair.PairType = VSVGPairType.SingleValue
			Pair.Value = index
            Pair.Render =  Enums.CAPIControlType.Values
			Pair.Status = index.ToString & " " & Chr(176) & "C"
			hs.DeviceVSP_AddPair(dv.Ref(hs), Pair)
       Next
	   
	   hs.SetDeviceValueByRef(dv.Ref(hs), 0 , False)
	   hs.SetDeviceString(dv.Ref(hs), "<img src='images/Homeseer/ui/5-x-5_trans_spacer.gif'>Thermostat Control", True)
	
	End If

	dvRef2 = hs.GetDeviceRef("OT_TempOverrideMode")
    if dvRef2 <= 0 then 
	   Dim DT As New DeviceTypeInfo

	   dv2 = hs.NewDeviceEx("Temperature Override Mode")
	   dv2.Location(hs) = hs.GetINISetting("HS", "Room", "", INI_FILE)
	   dv2.Location2(hs) = hs.GetINISetting("HS", "Floor", "", INI_FILE)
	   dv2.Code(hs) = "OT_TempOverrideMode"
	   dv2.Image(hs) = "images\OpenTherm\OT.png"
	   dv.AssociatedDevice_Add(hs, dv2.Ref(hs))
	   dv2.Relationship(hs) = Enums.eRelationship.Child  
	   dv2.MISC_Set(hs, Enums.dvMISC.SHOW_VALUES) 'This is &H100
	   dv2.MISC_Clear(hs, Enums.dvMISC.STATUS_ONLY) 'This is &H10
	   dv2.ScriptName(hs) = "BLB_OT_monitor.vb"
	   dv2.ScriptFunc(hs) = "SetTempOverrideMode"

	   DT.Device_API = DeviceTypeInfo.eDeviceAPI.Script
       DT.Device_Type = DeviceTypeInfo.eDeviceType_Script.Run_On_Value_Change
	   
	   dv2.DeviceType_Set(hs) = DT
	   
	   Pair = New VSPair(HomeSeerAPI.ePairStatusControl.Both)
       Pair.PairType = VSVGPairType.SingleValue
	   Pair.Value = 0
	   Pair.Render =  Enums.CAPIControlType.Values
	   Pair.Status = "Temporary"
	   hs.DeviceVSP_AddPair(dv2.Ref(hs), Pair)
	   
	   Pair = New VSPair(HomeSeerAPI.ePairStatusControl.Both)
       Pair.PairType = VSVGPairType.SingleValue
	   Pair.Value = 1
	   Pair.Render =  Enums.CAPIControlType.Values
	   Pair.Status = "Constant"
	   hs.DeviceVSP_AddPair(dv2.Ref(hs), Pair)
	   
	   hs.SetDeviceValueByRef(dv2.Ref(hs), 0 , False)
	   hs.SetDeviceString(dv2.Ref(hs), "<img src='images/Homeseer/ui/5-x-5_trans_spacer.gif'>Temporary", True)
	
	End If

End Sub

Private Declare Sub Sleep Lib "kernel32" Alias "Sleep" (ByVal dwMilliseconds As Long)


I run the script in a recurring event every 30 seconds with calling of Sub "Main" and parameter "update".

I hope this works for you as well!

Maurice
Attachments
OT_script_HS3.rar
(7.16 KiB) Downloaded 702 times
Last edited by mo046 on Fri Sep 18, 2015 11:51 am, edited 1 time in total.
** Maurice **
yoja
Starting Member
Starting Member
Posts: 44
Joined: Wed Feb 24, 2010 12:00 pm

Re: Opentherm gateway and script integration into Homeseer

Post by yoja »

Hi Maurice,

Great Job fixing the telnet communication! I didn't have the time to look into this myself.

Attached is a small modification for the HS3 icons.

Yoja
Attachments
BLB_OT_monitor_v3.rar
(5.34 KiB) Downloaded 709 times
raymonvdm
Senior Member
Senior Member
Posts: 1153
Joined: Sun Dec 18, 2011 1:23 am

Re: Opentherm gateway and script integration into Homeseer

Post by raymonvdm »

I`m not using a telnet function but the script was not working for me either. Should it work using the comport now ?
Running HS3PRO on PC with Z-Wave / OpenTherm / Plugwise / RFXcom / MQTT / XAP400 / Logitech Media Server and Squeezelite on PI`s
mo046
Member
Member
Posts: 186
Joined: Thu Nov 08, 2007 4:12 pm
Location: Netherlands

Re: Opentherm gateway and script integration into Homeseer

Post by mo046 »

Hi Yoja,

so it was you who made the first HS attemt. I edited my post to give you the credits!

I didn't have any problems with the physical telnet communication to the OTG, it was merely a timing issue abot when and how to poll for data from the gateway. This is what can happen as a response to a "P1" request:

Code: Select all

10:45:59.502405	T10010A00	Write-Data	Control setpoint: 10.00
10:45:59.606592	BD0010A00	Write-Ack 	Control setpoint: 10.00
10:46:00.459960	Command (via relay server, from 127.0.0.1:53410): PS=1
10:46:00.504501	T00110000	Read-Data 	Relative modulation level: 0.00
The P1 request it iterrupts the gateway communication between boiler and thermostat, and as a response it sends, in this example, the read-data.

This is what it should look like

Code: Select all

10:46:28.616586	B40194200	Read-Ack  	Boiler water temperature: 66.00
10:46:29.522552	T10010A00	Write-Data	Control setpoint: 10.00
10:46:29.638987	BD0010A00	Write-Ack 	Control setpoint: 10.00
10:46:30.082637	Command (via relay server, from 127.0.0.1:53433): PS=1
10:46:30.146678	PS: 1
10:46:30.294485	00000010/00000000,10.00,00000001/00000001,100.00,0/0,18.50,0.00,0.00,20.45,66.00,0.00,15.00,58.00,75/20,0/0,0.00,0.00,0,0,0,0,0,0,0,0
By sending a dummy P1 request I prepare the gateway and ignore its initial response. Then the data can be requested and it shows no errors. A proper datagram looks like this:

Code: Select all

11:34:00.120779	Command (via relay server, from 127.0.0.1:55861): PS=1
11:34:00.139398	PS: 1
11:34:00.327066	00000010/00000000,10.00,00000001/00000001,100.00,0/0,18.50,0.00,0.00,20.48,54.00,0.00,17.00,51.00,75/20,0/0,0.00,0.00,0,0,0,0,0,0,0,0
11:34:01.756517	Command (via relay server, from 127.0.0.1:55863): PS=1
11:34:01.784781	PS: 1
11:34:01.918611	00000010/00000000,10.00,00000001/00000001,100.00,0/0,18.50,0.00,0.00,20.48,54.00,0.00,17.00,51.00,75/20,0/0,0.00,0.00,0,0,0,0,0,0,0,0
11:34:02.171491	Command (via relay server, from 127.0.0.1:55864): PR=T
11:34:02.277492	PR: T=11
11:34:02.281280	Command (via relay server, from 127.0.0.1:55865): PR=R
11:34:02.310974	PR: R=D
11:34:02.313691	Command (via relay server, from 127.0.0.1:55866): PR=M
11:34:02.341475	PR: M=G
11:34:02.344579	Command (via relay server, from 127.0.0.1:55867): PR=V
11:34:02.373757	PR: V=3
11:34:02.376893	Command (via relay server, from 127.0.0.1:55868): PR=O
11:34:02.413201	PR: O=N
11:34:02.415904	Command (via relay server, from 127.0.0.1:55869): PR=W
11:34:02.445729	PR: W=A
11:34:02.448326	Command (via relay server, from 127.0.0.1:55870): PR=L
11:34:02.508242	PR: L=FXOMPC
11:34:02.511932	Command (via relay server, from 127.0.0.1:55871): PS=0
11:34:02.541876	PS: 0
Regarding the icons, I'm not happy with the current implementation. It is on my to-do list, haven't had time to look into it. Meanwhile I've done some icon definition in the device properties based on device value.
** Maurice **
yoja
Starting Member
Starting Member
Posts: 44
Joined: Wed Feb 24, 2010 12:00 pm

Re: Opentherm gateway and script integration into Homeseer

Post by yoja »

@Maurice: looking forward to your icon modifications.

@raymonvdm: current script has no comport implementation. You can run OTmonitor for telnet access.
raymonvdm
Senior Member
Senior Member
Posts: 1153
Joined: Sun Dec 18, 2011 1:23 am

Re: Opentherm gateway and script integration into Homeseer

Post by raymonvdm »

yoja wrote:@Maurice: looking forward to your icon modifications.

@raymonvdm: current script has no comport implementation. You can run OTmonitor for telnet access.
I did not know i could use OTmonitor for telnet access i did saw MQTT once but it is yet to difficult for me to understand. I`m now pending to setup the script for telnet :D

Which events do i need for the gateway to work correct in HS3 because i`m getting some errors

Code: Select all

sep-18 22:47:06	 	Error	SendMessage; OTGW: Unable to read data from the transport connection: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.

And i don`t have any devices for the gateway yet :oops:
Running HS3PRO on PC with Z-Wave / OpenTherm / Plugwise / RFXcom / MQTT / XAP400 / Logitech Media Server and Squeezelite on PI`s
mo046
Member
Member
Posts: 186
Joined: Thu Nov 08, 2007 4:12 pm
Location: Netherlands

Re: Opentherm gateway and script integration into Homeseer

Post by mo046 »

In hssi_BLB_OT_monitor.ini set

Code: Select all

[Telnet]
TCPAddress=127.0.0.1
TCPPort=7686

[Debug]
Debug=0

[HS]
Floor=Zolder
Room=CV-ketel
to your needs (TCPAddress=127.0.0.1 is OK if you run the Opentherm Monitor on the same PC as your HS3, otherwise specify the IP adress of the computer runnung the Opentherm Monitor).

In the Opentherm Monitor click Options, than Remote Access. In the settings activate both checkboxes and set the port to 7686.
In the configuration screen, select Miscellaneous and set the Operating mode to Gateway.
In the configuration screen, select Connection and set the correct connection parameters according to how you connect your PC with the gateway.
Click Done when you're finished.
** Maurice **
raymonvdm
Senior Member
Senior Member
Posts: 1153
Joined: Sun Dec 18, 2011 1:23 am

Re: Opentherm gateway and script integration into Homeseer

Post by raymonvdm »

I have made this settings and it is working. But which events do i need for all devices to be created ?
Running HS3PRO on PC with Z-Wave / OpenTherm / Plugwise / RFXcom / MQTT / XAP400 / Logitech Media Server and Squeezelite on PI`s
mo046
Member
Member
Posts: 186
Joined: Thu Nov 08, 2007 4:12 pm
Location: Netherlands

Re: Opentherm gateway and script integration into Homeseer

Post by mo046 »

Devices should be created automatically if they don't exist.
** Maurice **
Post Reply

Return to “Homeseer Scripts Forum”