Announcement

Collapse
No announcement yet.

errors updating to 1.6.4

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • mhn
    replied
    I guess you deleted the bad plugin in the past then. :-)

    Leave a comment:


  • akatar
    replied
    it still works after 10 reboots

    Leave a comment:


  • mhn
    replied
    Originally posted by akatar View Post
    that did the trick,it's working now
    but no idea why of who of what placed a copy in the install directory
    You will know after the next HS3 boot. :-)

    Then make a .config for that plugin.

    Leave a comment:


  • w.vuyk
    replied
    good to hear it is solved now

    Leave a comment:


  • akatar
    replied
    that did the trick,it's working now
    but no idea why of who of what placed a copy in the install directory

    Leave a comment:


  • w.vuyk
    replied
    The dll should not be in the installation directory. If you remove it from the installation directory, which plugin or script is starting to protest.

    Wim

    Leave a comment:


  • akatar
    replied
    both, in homeseer 3 directory and in homeseer3..../bin/jowihue directory

    Leave a comment:


  • w.vuyk
    replied
    Akatar,

    Did you check for the newtonsoft.json.dll? Where is it installed in your situation? Is it in the installation directory or the bin directory?

    Wim

    Leave a comment:


  • akatar
    replied
    same problem here
    error - De conversie van tekenreeks "" naar type Integer is ongeldig

    <TABLE class=log_table_row style="WIDTH: 970px; WHITE-SPACE: normal; WORD-SPACING: 0px; TABLE-LAYOUT: fixed; TEXT-TRANSFORM: none; COLOR: rgb(0,0,0); FONT: 13px 'Lucida Console', Monaco, monospace; WIDOWS: 1; LETTER-SPACING: normal; BACKGROUND-COLOR: rgb(255,255,255); TEXT-INDENT: 0px; -webkit-text-stroke-width: 0px" cellSpacing=0> <TBODY> <TR> <TD class="LogDateLong LogDateTime1" style="FONT-SIZE: 10pt; FONT-FAMILY: Courier-New, Monaco, monospace; WIDTH: 150px; BACKGROUND: rgb(255,255,255); WHITE-SPACE: nowrap; PADDING-LEFT: 3px; PADDING-RIGHT: 3px" align=left>okt-18 12:18:01</TD> <TD class=LogPri1 style="FONT-SIZE: 9pt; FONT-FAMILY: Courier-New, Monaco, monospace; WIDTH: 30px; BACKGROUND: rgb(255,255,255); PADDING-LEFT: 3px; PADDING-RIGHT: 3px" align=left></TD> <TD class=LogType1 style="FONT-SIZE: 9pt; FONT-FAMILY: Courier-New, Monaco, monospace; WIDTH: 100px; BACKGROUND: rgb(255,255,255); PADDING-LEFT: 3px; PADDING-RIGHT: 3px" colSpan=3 align=left>JowiHue</TD> <TD class=LogEntry1 style="WORD-WRAP: break-word; FONT-SIZE: 9pt; FONT-FAMILY: Courier-New, Monaco, monospace; BACKGROUND: rgb(255,255,255); PADDING-LEFT: 3px; PADDING-RIGHT: 3px" colSpan=8 align=left>Bridge "" reconnected</TD></TR></TBODY></TABLE>
    <TABLE class=log_table_row style="WIDTH: 970px; WHITE-SPACE: normal; WORD-SPACING: 0px; TABLE-LAYOUT: fixed; TEXT-TRANSFORM: none; COLOR: rgb(0,0,0); FONT: 13px 'Lucida Console', Monaco, monospace; WIDOWS: 1; LETTER-SPACING: normal; BACKGROUND-COLOR: rgb(255,255,255); TEXT-INDENT: 0px; -webkit-text-stroke-width: 0px" cellSpacing=0> <TBODY> <TR> <TD class="LogDateLong LogDateTime0" style="FONT-SIZE: 10pt; FONT-FAMILY: Courier-New, Monaco, monospace; WIDTH: 150px; BACKGROUND: rgb(239,239,239); WHITE-SPACE: nowrap; PADDING-LEFT: 3px; PADDING-RIGHT: 3px" align=left>okt-18 12:18:01</TD> <TD class=LogPri0 style="FONT-SIZE: 9pt; FONT-FAMILY: Courier-New, Monaco, monospace; WIDTH: 30px; BACKGROUND: rgb(239,239,239); PADDING-LEFT: 3px; PADDING-RIGHT: 3px" align=left></TD> <TD class=LogType0 style="FONT-SIZE: 9pt; FONT-FAMILY: Courier-New, Monaco, monospace; WIDTH: 100px; BACKGROUND: rgb(239,239,239); PADDING-LEFT: 3px; PADDING-RIGHT: 3px" colSpan=3 align=left>JowiHue</TD> <TD class=LogEntry0 style="WORD-WRAP: break-word; FONT-SIZE: 9pt; FONT-FAMILY: Courier-New, Monaco, monospace; BACKGROUND: rgb(239,239,239); PADDING-LEFT: 3px; PADDING-RIGHT: 3px" colSpan=8 align=left>GetBridgeConfig:Error:GetBridgeConfig: Is bridge reachable? Kan bestand of assembly Newtonsoft.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed of een van de afhankelijkheden hiervan niet laden. De manifestdefinitie van de gevonden assembly komt niet overeen met de assembly-verwijzing. (Uitzondering van HRESULT: 0x80131040)</TD></TR></TBODY></TABLE>


    Leave a comment:


  • bartbakels
    replied
    Originally posted by w.vuyk View Post
    Bart,

    I guess you had the same lines for the import before too?
    Do you have more scripts using the newtonsoft.json.dll or is this the only one?

    If it is the only one, do you have the line for scriptingreferences correct? Watch the comma and semicolon sequences. Here is my complete line for reference:

    ScriptingReferences=System.Drawing;System.Drawing.dll,System .Web;System.web.dll,System.Data.SQLite;c:\hs3\bin\System.Dat a.SQLite.dll

    (ignore the weird space near system.web, this board has this issue for years already )

    Although I would not promote it, a work around for now could be done by restoring the original line as you had it and copy the newtonsoft.json.dll from the bin\jowihue to the installation directory, that way making sure the versions match.

    Regards,

    Wim

    Wim,

    Yes the script is unchanged.

    I tried also putting the dll in C:\test and checked upper/lower case. Still no luck
    looking like this for now:

    ScriptingReferences=System.XML;System.XML.dll,System.Data;Sy stem.Data.Dll,System.Web;System.Web.dll,System.Web.DataVisua lization;System.Web.DataVisualization.dll,System.Drawing;Sys tem.Drawing.dll,Newtonsoft.Json;C:\Program Files (x86)\Homeseer HS3\Bin\newtonsoftJSON\Newtonsoft.Json.dll

    and i tried this in the HS3.exe.config;

    HTML Code:
    <?xml version="1.0"?>
    <configuration>
        <startup>
            <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
        </startup>
      <runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
          <probing privatePath="bin"/>
    
    
    <dependentAssembly>
             <assemblyIdentity name="Newtonsoft.Json"
                               publicKeyToken="30ad4fe6b2a6aeed"
                               culture="neutral" />
             <!-- 
               Assembly versions can be redirected in application, 
               publisher policy, or machine configuration files.
             -->
             <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="7.0.1.18622"/>
           </dependentAssembly>
    
    
    
    
        </assemblyBinding>
      </runtime>
    </configuration>
    also no luck yet... however this caused me to change the error that it cant find assembly from version 7 instead of 4.5. so i guess its going wrong in the scriptingreferences


    Bart

    Leave a comment:


  • w.vuyk
    replied
    Bart,

    Another possibility could be to check the casing in the references line. Would it respond different if instead of c:\program files(x86)\.... you use the correct casing like C:\Program Files(x86)....... ?

    Wim

    Leave a comment:


  • w.vuyk
    replied
    Bart,

    I guess you had the same lines for the import before too?
    Do you have more scripts using the newtonsoft.json.dll or is this the only one?

    If it is the only one, do you have the line for scriptingreferences correct? Watch the comma and semicolon sequences. Here is my complete line for reference:

    ScriptingReferences=System.Drawing;System.Drawing.dll,System .Web;System.web.dll,System.Data.SQLite;c:\hs3\bin\System.Dat a.SQLite.dll

    (ignore the weird space near system.web, this board has this issue for years already )

    Although I would not promote it, a work around for now could be done by restoring the original line as you had it and copy the newtonsoft.json.dll from the bin\jowihue to the installation directory, that way making sure the versions match.

    Regards,

    Wim

    Leave a comment:


  • bartbakels
    replied
    wim,

    however, I still have one script that is causing issues, not sure if the scripting references are ok. I have spaces in the path. but same when I put it in c:\test\*.dll, so i guess thats not the issue. scripting references are:

    Code:
    Newtonsoft.Json;c:\program files (x86)\Homeseer HS3\bin\newtonsoftJSON\Newtonsoft.Json.dll
    Error:

    Code:
    okt-05 19:29:43	 	Error 1	Running script C:\Program Files (x86)\HomeSeer HS3\scripts\ThinkingCleaner.vb :Exception has been thrown by the target of an invocation.Could not load file or assembly 'Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The system cannot find the file specified.
    Its regarding my thinkingcleaner script, i guess the imports? any ideas?

    Code:
    Imports Newtonsoft.Json
    Imports Newtonsoft.Json.Linq
    
    Sub Main(params as object)
    	
    	'Control Thinking cleaner Roomba Control For Homeseer3
    	'Made by Bart Bakels/ Promedes.nl
    	
    
    	'ONLY USE With HS3 v81 and above
    	
    	'Enable Debug Messages Level
    	'0=None
    	'1=Info
    	'2=All
    	
    	Dim Debug = 0
    
    	
    	'=====================================================================
    	
    	'Get parameters
    	Dim parameters(3) as String
    	parameters = params.Split("|")
    	
    	
    	Dim scriptaction As String = parameters(0)
    	
    	If Debug = 2 Then 
    				hs.WriteLog("Thinking cleaner Action requested", scriptaction)
    	End If
    	'====================================
    	'DIM Parameters
    	'====================================
    	
    	
    	Dim indexstart
    	Dim indexend
    	Dim errorflag
    	Dim response
    	Dim subresponse
    	Dim success
    	
    	
    	'Roomba statusses
    	Dim IP
    	
    	dim batterycharge
    	dim cleanerstate
    	dim modelnr
    	dim name
    	dim cleaningdistance
    	dim cleaningtimetotal
    	dim binstatus
    	dim cleaningtime
    	
    	'JSON
    	Dim json As String 'this is the string of json data that needs decoding
    	Dim obj As New Object
    	
    	
    	'homeseer connection Declaring
    	Dim dv As Scheduler.Classes.DeviceClass = Nothing
    	Dim Value
    	Dim ValueText
    	Dim ValueTextOld
    	Dim Graphic
    	Dim DevExists
    	Dim GPair = New VGPair
    	Dim Ref
    	
    	
    	
    	
    	'======================
    	'Find Roomba
    	'======================
    	
    	If errorflag = 0 Then 'errorcheck
    		
    		 response = hs.URLAction("http://tc.thinkingsync.com/api/v1/discover/devices","GET", "", "")
    
    		response=response.Replace("[", "")
    		response=response.Replace("]", "")
    		
    		indexstart = InStr(response, "uuid")
    		
    		If indexstart = 0 Then
    			hs.WriteLog("Thinking cleaner Error", "Find roomba, No reponse")
    			errorflag = 1
    		End If	
    		
    		If response = Nothing Then
    			hs.WriteLog("Thinking cleaner Error", "Find roomba, No reponse")
    			errorflag = 1
    		End If
    		
    		If Debug = 2 Then 
    			hs.WriteLog("Thinking cleaner Find Roomba", response)
    		End If
    		
    	End If ' errorcheck
    	
    	
    	
    	'======================
    	'Find IP
    	'======================
    	
    	If errorflag = 0 Then 'errorcheck
    	
    	obj = JsonConvert.DeserializeObject(response)
    	IP = obj.Item("local_ip").ToString
    
    		If Debug > 1 Then
    		hs.WriteLog("Thinking cleaner IP",  IP)
    		End If
    		
    	
    	End If ' errorcheck
    	
    	
    	'======================
    	'Get Roomba status
    	'======================
    	
    	If errorflag = 0 Then 'errorcheck
    	
    	response = hs.URLAction("http://" & IP & "/status.json","GET", "", "")
    	
    			If Debug = 2 Then 
    				hs.WriteLog("Thinking cleaner Status", response)
    			End If
    
    		obj = JsonConvert.DeserializeObject(response)
    		success = obj.Item("result").ToString
    
    		If Debug > 1 Then 
    			hs.WriteLog("Thinking cleaner simple status",  success)
    		End If
    
    		if NOT success = "success" 
    		errorflag = 1
    		End if
    	
    	End If ' errorcheck
    	
    		
    	'======================
    	'Decode Roomba status
    	'======================
    	
    	'status JSON string
    	'---------------------------
    	
    	If errorflag = 0 Then 'errorcheck
    		response = obj.Item("status").ToString
    			If Debug = 2 Then
    			hs.WriteLog("Thinking cleaner deserialize status",  response)
    			End If
    		obj = JsonConvert.DeserializeObject(response)
    	End If ' errorcheck
    	
    	
    	'find name
    	'---------------------------
    	
    	If errorflag = 0 Then 'errorcheck
    	
    			obj = JsonConvert.DeserializeObject(response)
    
    			name = obj.Item("name").ToString
    			
    			If Debug > 0 Then 
    			hs.WriteLog("Thinking cleaner name",  name)
    			End If
    	
    
    	End If ' errorcheck
    
    	
    	'find batterycharge
    	'---------------------------
    	
    	
    	If errorflag = 0 Then 'errorcheck
    	
    			batterycharge = obj.Item("battery_charge").ToString
    			
    			If Debug > 0 Then 
    			hs.WriteLog("Thinking cleaner battery charge",  batterycharge)
    			End If
    			
    			
    	End If ' errorcheck
    
    
    	'find capacity
    	'---------------------------
    	
    	
    	If errorflag = 0 Then 'errorcheck
    	
    			dim capacity = obj.Item("capacity").ToString
    			
    			If Debug > 0 Then 
    			hs.WriteLog("Thinking cleaner capacity",  capacity)
    			End If
    			
    			
    	End If ' errorcheck
    
    
    
    	'find cleaner state
    	'---------------------------
    	
    	
    	If errorflag = 0 Then 'errorcheck
    	
    			cleanerstate = obj.Item("cleaner_state").ToString
    			
    			If Debug > 0 Then 
    			hs.WriteLog("Thinking cleaner state",  cleanerstate)
    			End If
    			
    			
    	End If ' errorcheck
    
    
    
    	'find cleaner cleaning
    	'---------------------------
    	
    	
    	If errorflag = 0 Then 'errorcheck
    	
    			dim cleaning = obj.Item("cleaning").ToString
    			
    			If Debug > 0 Then 
    			hs.WriteLog("Thinking cleaner cleaning",  cleaning)
    			End If
    			
    			
    	End If ' errorcheck
    
    
    
    	'find cleaner near_homebase
    	'---------------------------
    	
    	
    	If errorflag = 0 Then 'errorcheck
    	
    			dim nearhomebase = obj.Item("near_homebase").ToString
    			
    			If Debug > 0 Then 
    			hs.WriteLog("Thinking cleaner near_homebase",  nearhomebase)
    			End If
    			
    			
    	End If ' errorcheck
    	
    	'======================
    	'Get Roomba FULL status
    	'======================
    	
    	If errorflag = 0 Then 'errorcheck
    	
    	response = hs.URLAction("http://" & IP & "/full_status.json","GET", "", "")
    	
    			If Debug = 2 Then 
    				hs.WriteLog("Thinking cleaner FULL Status", response)
    			End If
    
    		obj = JsonConvert.DeserializeObject(response)
    		success = obj.Item("result").ToString
    
    		If Debug > 1 Then 
    			hs.WriteLog("Thinking cleaner full status",  success)
    		End If
    
    		if NOT success = "success" 
    		errorflag = 1
    		End if
    	
    	End If ' errorcheck
    	
    	
    			
    	'======================
    	'Decode Roomba FULL status
    	'======================
    	
    	'tc_status JSON string
    	'---------------------------
    	
    	If errorflag = 0 Then 'errorcheck
    		subresponse = obj.Item("tc_status").ToString
    			If Debug = 2 Then
    			hs.WriteLog("Thinking cleaner deserialize tc_status",  subresponse)
    			End If
    		obj = JsonConvert.DeserializeObject(subresponse)
    	End If ' errorcheck
    
    
    	'find modelnr
    	'---------------------------
    	
    	
    	If errorflag = 0 Then 'errorcheck
    	
    			modelnr = obj.Item("modelnr").ToString
    			
    			If Debug > 0 Then 
    			hs.WriteLog("Thinking cleaner modelnr",  modelnr)
    			End If
    			
    	End If ' errorcheck
    	
    	'find cleaning_time
    	'---------------------------
    	
    	
    	If errorflag = 0 Then 'errorcheck
    	
    			cleaningtime = obj.Item("cleaning_time").ToString
    			
    			If Debug > 0 Then 
    			hs.WriteLog("Thinking cleaner cleaning time",  cleaningtime)
    			End If
    			
    	End If ' errorcheck
    
    
    	'find cleaning_time_total
    	'---------------------------
    	
    	
    	If errorflag = 0 Then 'errorcheck
    	
    			cleaningtimetotal = obj.Item("cleaning_time_total").ToString
    			
    			If Debug > 0 Then 
    			hs.WriteLog("Thinking cleaner cleaning time total",  cleaningtimetotal)
    			End If
    						
    	End If ' errorcheck
    
    
    	'find cleaning_distance
    	'---------------------------
    	
    	
    	If errorflag = 0 Then 'errorcheck
    	
    			cleaningdistance = obj.Item("cleaning_distance").ToString
    			
    			If Debug > 0 Then 
    			hs.WriteLog("Thinking cleaner cleaning distance",  cleaningdistance)
    			End If
    						
    	End If ' errorcheck
    	
    	
    	'find bin_status
    	'---------------------------
    	
    	
    	If errorflag = 0 Then 'errorcheck
    	
    			binstatus = obj.Item("bin_status").ToString
    			
    			If Debug > 0 Then 
    			hs.WriteLog("Thinking cleaner bin status",  binstatus)
    			End If
    						
    	End If ' errorcheck
    	
    	
    	
    		'======================
    		'Create/Update HomeseerDevices
    		'======================
    		If errorflag = 0 Then 'errorcheck
    		
    		'Current batterycharge
    		'-------------------------
    		Value = batterycharge
    		ValueText = Value & " %"
    		
    		If Value <> Nothing Then
    			DevExists = hs.DeviceExistsAddress("ThinkingCleaner-Batterycharge", False)
    			
    			If DevExists = -1 Then 
    				dv = hs.NewDeviceEx("Roomba Batterij niveau")
    				dv.Location(hs) = "Roomba"
    				dv.Location2(hs) = "Status"
    				dv.Address(hs) = "ThinkingCleaner-Batterycharge"
    				dv.Device_Type_String(hs) = "Thinking Cleaner"
    				dv.Image(hs) = "/images/thinkingcleaner/thinkingcleaner.png"
    				
    				Ref = hs.GetDeviceRef("ThinkingCleaner-Batterycharge")
    				
    				GPair = New VGPair
    				GPair.PairType = VSVGPairType.Range
    				GPair.RangeStart = 90
    				GPair.RangeEnd = 100
    				GPair.Graphic = "/images/thinkingcleaner/battery-full.png"
    				hs.DeviceVGP_AddPair(ref, GPair)
    				
    				GPair = New VGPair
    				GPair.PairType = VSVGPairType.Range
    				GPair.RangeStart = 50
    				GPair.RangeEnd = 89
    				GPair.Graphic = "/images/thinkingcleaner/battery-75.png"
    				hs.DeviceVGP_AddPair(ref, GPair)
    				
    				GPair = New VGPair
    				GPair.PairType = VSVGPairType.Range
    				GPair.RangeStart = 11
    				GPair.RangeEnd = 49
    				GPair.Graphic = "/images/thinkingcleaner/battery-50.png"
    				hs.DeviceVGP_AddPair(ref, GPair)
    				
    				GPair = New VGPair
    				GPair.PairType = VSVGPairType.Range
    				GPair.RangeStart = 0
    				GPair.RangeEnd = 10
    				GPair.Graphic = "/images/thinkingcleaner/battery-empty.png"
    				hs.DeviceVGP_AddPair(ref, GPair)
    				
    				hs.WriteLog("Thinking cleaner device creation",  "Battery charge device")
    			End If
    			
    			Ref = hs.GetDeviceRef("ThinkingCleaner-Batterycharge")
    			ValueTextOld = hs.DeviceString(Ref)
    			
    			if NOT ValueTextOld = ValueText Then
    			hs.SetDeviceString(Ref, Valuetext , True)
    			hs.SetDeviceValueByRef(Ref, Value , False)
    			End If
    		
    					
    		End If
    		
    		'Current cleanerstate
    		'-------------------------
    		
    		Valuetext = "Error: onbekende status"
    		Value = 100
    	
    		if cleanerstate = "st_base" then
    		Valuetext = "Gedocked: niet aan het laden"
    		Value = 1
    		end if
    		if cleanerstate = "st_base_recon" then
    		Valuetext = "Gedocked: Reconditioning accu"
    		Value = 2
    		end if
    		if cleanerstate = "st_base_full" then
    		Valuetext = "Gedocked: Accu Vol"
    		Value = 3
    		end if
    		if cleanerstate = "st_base_trickle" then
    		Valuetext = "Gedocked: Accu Druppelladen"
    		Value = 4
    		end if
    		if cleanerstate = "st_base_wait" then
    		Valuetext = "Gedocked: In Wacht"
    		Value = 5
    		end if
    		if cleanerstate = "st_plug" then
    		Valuetext = "Aan lader: niet aan het laden"
    		Value = 6
    		end if
    		if cleanerstate = "st_plug_recon" then
    		Valuetext = "Aan lader: Reconditioning accu"
    		Value = 7
    		end if
    		if cleanerstate = "st_plug_full" then
    		Valuetext = "Aan lader: Accu Vol"
    		Value = 8
    		end if
    		if cleanerstate = "st_plug_trickle" then
    		Valuetext = "Aan lader: Accu Druppelladen"
    		Value = 9
    		end if
    		if cleanerstate = "st_plug_wait" then
    		Valuetext = "Aan lader: In Wacht"
    		Value = 10
    		end if
    		if cleanerstate = "st_stopped" then
    		Valuetext = "Gestopt"
    		Value = 11
    		end if
    		if cleanerstate = "st_clean" then
    		Valuetext = "Stofzuigen Actief"
    		Value = 12
    		end if
    		if cleanerstate = "st_cleanstop" then
    		Valuetext = "Stofzuigen gestopt"
    		Value = 13
    		end if
    		if cleanerstate = "st_clean_spot" then
    		Valuetext = "Spot cleaning Actief"
    		Value = 14
    		end if
    		if cleanerstate = "st_clean_max" then
    		Valuetext = "Max cleaning Actief"
    		Value = 15
    		end if
    		if cleanerstate = "st_delayed" then
    		Valuetext = "vertraagd schoonmaken start binnenkort"
    		Value = 16
    		end if
    		if cleanerstate = "st_dock" then
    		Valuetext = "Zoekt dockingstation"
    		Value = 17
    		end if
    		if cleanerstate = "st_pickup" then
    		Valuetext = "Roomba opgepakt; Wielen Los"
    		Value = 18
    		end if
    		if cleanerstate = "st_remote" then
    		Valuetext = "Wordt remote bestuurd"
    		Value = 19
    		end if
    		if cleanerstate = "st_wait" then
    		Valuetext = "Wacht op commando"
    		Value = 20
    		end if
    		if cleanerstate = "st_off" then
    		Valuetext = "Uitgeschakeld"
    		Value = 21
    		end if
    		
    		
    		
    				
    		If Valuetext <> Nothing Then
    			DevExists = hs.DeviceExistsAddress("ThinkingCleaner-Status", False)
    			
    			If DevExists = -1 Then 
    				dv = hs.NewDeviceEx("Roomba Status")
    				dv.Location(hs) = "Roomba"
    				dv.Location2(hs) = "Status"
    				dv.Address(hs) = "ThinkingCleaner-Status"
    				dv.Device_Type_String(hs) = "Thinking Cleaner"
    				dv.Image(hs) = "/images/thinkingcleaner/thinkingcleaner.png"
    				dv.MISC_Set(hs, Enums.dvMISC.SHOW_VALUES)
    				
    				Ref = hs.GetDeviceRef("ThinkingCleaner-Status")
    				
    				
    				GPair = New VGPair
    				GPair.PairType = VSVGPairType.Range
    				GPair.RangeStart = 0
    				GPair.RangeEnd = 200
    				GPair.Graphic = "/images/thinkingcleaner/status.png"
    				hs.DeviceVGP_AddPair(ref, GPair)
    				
    				GPair = New VGPair
    				GPair.PairType = VSVGPairType.Range
    				GPair.RangeStart = 1
    				GPair.RangeEnd = 5
    				GPair.Graphic = "/images/thinkingcleaner/docked.png"
    				hs.DeviceVGP_AddPair(ref, GPair)
    				
    				GPair = New VGPair
    				GPair.PairType = VSVGPairType.SingleValue
    				GPair.Set_Value = 100
    				GPair.Graphic = "/images/thinkingcleaner/error.png"
    				hs.DeviceVGP_AddPair(ref, GPair)
    				
    				GPair = New VGPair
    				GPair.PairType = VSVGPairType.SingleValue
    				GPair.Set_Value = 1
    				GPair.Graphic = "/images/thinkingcleaner/error.png"
    				hs.DeviceVGP_AddPair(ref, GPair)
    				
    				GPair = New VGPair
    				GPair.PairType = VSVGPairType.SingleValue
    				GPair.Set_Value = 11
    				GPair.Graphic = "/images/thinkingcleaner/stop.png"
    				hs.DeviceVGP_AddPair(ref, GPair)
    				
    				GPair = New VGPair
    				GPair.PairType = VSVGPairType.SingleValue
    				GPair.Set_Value = 12
    				GPair.Graphic = "/images/thinkingcleaner/clean.png"
    				hs.DeviceVGP_AddPair(ref, GPair)
    									
    				GPair = New VGPair
    				GPair.PairType = VSVGPairType.SingleValue
    				GPair.Set_Value = 13
    				GPair.Graphic = "/images/thinkingcleaner/stop.png"
    				hs.DeviceVGP_AddPair(ref, GPair)
    				
    				GPair = New VGPair
    				GPair.PairType = VSVGPairType.SingleValue
    				GPair.Set_Value = 21
    				GPair.Graphic = "/images/thinkingcleaner/off.png"
    				hs.DeviceVGP_AddPair(ref, GPair)
    				
    				
    				'Button Test
    				hs.DeviceScriptButton_AddButton(ref, "Clean","0","thinkingcleaner.vb","Actions","Clean",1,1,0)
    				hs.DeviceScriptButton_AddButton(ref, "CleanMAX","1","thinkingcleaner.vb","Actions","CleanMax",1,2,0)
    				hs.DeviceScriptButton_AddButton(ref, "CleanSpot","2","thinkingcleaner.vb","Actions","Spot",1,3,0)
    				hs.DeviceScriptButton_AddButton(ref, "Dock","3","thinkingcleaner.vb","Actions","Dock",1,4,0)
    				hs.DeviceScriptButton_AddButton(ref, "FindMe","4","thinkingcleaner.vb","Actions","FindMe",1,5,0)
    				
    				
    				hs.WriteLog("Thinking cleaner device creation",  "Status device")
    			End If
    			
    			Ref = hs.GetDeviceRef("ThinkingCleaner-Status")
    			ValueTextOld = hs.DeviceString(Ref)
    			
    			if NOT ValueTextOld = ValueText Then
    			hs.SetDeviceString(Ref, Valuetext , True)
    			hs.SetDeviceValueByRef(Ref, Value , False)
    			End If
    			
    		End If
    		
    		'name and type
    		'-------------------------
    		Valuetext = "name:  "& name & "  type:  " & modelnr
    						
    		If Valuetext <> Nothing Then
    			DevExists = hs.DeviceExistsAddress("ThinkingCleaner-nametype", False)
    			
    			If DevExists = -1 Then 
    				dv = hs.NewDeviceEx("Roomba Name/Type")
    				dv.Location(hs) = "Roomba"
    				dv.Location2(hs) = "Status"
    				dv.Address(hs) = "ThinkingCleaner-nametype"
    				dv.Device_Type_String(hs) = "Thinking Cleaner"
    				dv.Image(hs) = "/images/thinkingcleaner/thinkingcleaner.png"
    				
    				
    				Ref = hs.GetDeviceRef("ThinkingCleaner-nametype")
    				
    				GPair = New VGPair
    				GPair.PairType = VSVGPairType.Range
    				GPair.RangeStart = 0
    				GPair.RangeEnd = 200
    				GPair.Graphic = "/images/thinkingcleaner/status.png"
    				hs.DeviceVGP_AddPair(ref, GPair)
    				
    				
    										
    				hs.WriteLog("Thinking cleaner device creation",  "Name and Type device")
    			End If
    			
    			Ref = hs.GetDeviceRef("ThinkingCleaner-nametype")
    			ValueTextOld = hs.DeviceString(Ref)
    			
    			if NOT ValueTextOld = ValueText Then
    			hs.SetDeviceString(Ref, Valuetext , True)
    			End If
    			
    		End If
    		
    		'distance
    		'-------------------------
    		Value = cleaningdistance
    		Valuetext = cleaningdistance & " m"
    						
    		If Valuetext <> Nothing Then
    			DevExists = hs.DeviceExistsAddress("ThinkingCleaner-distance", False)
    			
    			If DevExists = -1 Then 
    				dv = hs.NewDeviceEx("Roomba Totale Afstand")
    				dv.Location(hs) = "Roomba"
    				dv.Location2(hs) = "Status"
    				dv.Address(hs) = "ThinkingCleaner-distance"
    				dv.Device_Type_String(hs) = "Thinking Cleaner"
    				dv.Image(hs) = "/images/thinkingcleaner/thinkingcleaner.png"
    				
    				
    				Ref = hs.GetDeviceRef("ThinkingCleaner-distance")
    				
    				GPair = New VGPair
    				GPair.PairType = VSVGPairType.Range
    				GPair.RangeStart = 0
    				GPair.RangeEnd = 100000000
    				GPair.Graphic = "/images/thinkingcleaner/distance.png"
    				hs.DeviceVGP_AddPair(ref, GPair)
    		
    				
    				
    				hs.WriteLog("Thinking cleaner device creation",  "Distance device")
    			End If
    			
    			Ref = hs.GetDeviceRef("ThinkingCleaner-distance")
    			ValueTextOld = hs.DeviceString(Ref)
    			
    			if NOT ValueTextOld = ValueText Then
    			hs.SetDeviceString(Ref, Valuetext , True)
    			hs.SetDeviceValueByRef(Ref, Value , False)
    			End If
    			
    		End If
    	
    		'cleaningtime
    		'-------------------------
    		Value = cleaningtimetotal
    		Valuetext = "laatste Run: " & cleaningtime & " min, totaal: "& cleaningtimetotal & " min"
    						
    		If Valuetext <> Nothing Then
    			DevExists = hs.DeviceExistsAddress("ThinkingCleaner-cleaningtime", False)
    			
    			If DevExists = -1 Then 
    				dv = hs.NewDeviceEx("Roomba Totale schoonmaak Tijd")
    				dv.Location(hs) = "Roomba"
    				dv.Location2(hs) = "Status"
    				dv.Address(hs) = "ThinkingCleaner-cleaningtime"
    				dv.Device_Type_String(hs) = "Thinking Cleaner"
    				dv.Image(hs) = "/images/thinkingcleaner/thinkingcleaner.png"
    				
    				
    				Ref = hs.GetDeviceRef("ThinkingCleaner-cleaningtime")
    				
    				GPair = New VGPair
    				GPair.PairType = VSVGPairType.Range
    				GPair.RangeStart = 0
    				GPair.RangeEnd = 100000000
    				GPair.Graphic = "/images/thinkingcleaner/time.png"
    				hs.DeviceVGP_AddPair(ref, GPair)
    		
    				
    				
    				hs.WriteLog("Thinking cleaner device creation",  "total cleaning time device")
    			End If
    			
    			Ref = hs.GetDeviceRef("ThinkingCleaner-cleaningtime")
    			ValueTextOld = hs.DeviceString(Ref)
    			
    			if NOT ValueTextOld = ValueText Then
    			hs.SetDeviceString(Ref, Valuetext , True)
    			hs.SetDeviceValueByRef(Ref, Value , False)
    			End If
    			
    		End If
    		
    		'binstatus
    		'-------------------------
    				if binstatus = 0 then
    		value = 0
    		Valuetext = "Leeg"
    		end if
    		
    		if binstatus = 1 then
    		value = 100
    		Valuetext = "Vol"
    		End If
    								
    		If Valuetext <> Nothing Then
    			DevExists = hs.DeviceExistsAddress("ThinkingCleaner-binstatus", False)
    			
    			If DevExists = -1 Then 
    				dv = hs.NewDeviceEx("Roomba Opvangbak")
    				dv.Location(hs) = "Roomba"
    				dv.Location2(hs) = "Status"
    				dv.Address(hs) = "ThinkingCleaner-binstatus"
    				dv.Device_Type_String(hs) = "Thinking Cleaner"
    				dv.Image(hs) = "/images/thinkingcleaner/thinkingcleaner.png"
    				
    				
    				Ref = hs.GetDeviceRef("ThinkingCleaner-binstatus")
    				
    				GPair = New VGPair
    				GPair.PairType = VSVGPairType.Range
    				GPair.RangeStart = 0
    				GPair.RangeEnd = 100000000
    				GPair.Graphic = "/images/thinkingcleaner/bin.png"
    				hs.DeviceVGP_AddPair(ref, GPair)
    				
    				hs.WriteLog("Thinking cleaner device creation",  "binstatus device")
    			End If
    			
    			Ref = hs.GetDeviceRef("ThinkingCleaner-binstatus")
    			ValueTextOld = hs.DeviceString(Ref)
    			
    			if NOT ValueTextOld = ValueText Then
    			hs.SetDeviceString(Ref, Valuetext , True)
    			hs.SetDeviceValueByRef(Ref, Value , False)
    			End If
    			
    		End If
    		
    	'end error check	
    	End If ' errorcheck
    	
    	'==================================================================
    	'ACTIONS
    	'==================================================================
    	
    	'======================
    	'Dock
    	'======================
    	if scriptaction = "Dock" then
    	If errorflag = 0 Then 'errorcheck
    	
    	response = hs.URLAction("http://" & IP & "/command.json?command=dock","GET", "", "")
    	
    			If Debug = 2 Then 
    				hs.WriteLog("Thinking cleaner Dock", response)
    			End If
    			
    	hs.WriteLog("Thinking cleaner dock", "success")
    	
    	
    	End If ' errorcheck
    	End If
    	
    	
    	
    	'======================
    	'Maxclean
    	'======================
    	if scriptaction = "Maxclean" then
    	If errorflag = 0 Then 'errorcheck
    	
    	response = hs.URLAction("http://" & IP & "/command.json?command=max","GET", "", "")
    	
    			If Debug = 2 Then 
    				hs.WriteLog("Thinking cleaner Start Maxclean", response)
    			End If
    			
    	hs.WriteLog("Thinking cleaner Start Maxclean", "success")
    	
    	End If ' errorcheck
    	End If
    	
    	'======================
    	'clean
    	'======================
    	if scriptaction = "Clean" then
    	If errorflag = 0 Then 'errorcheck
    	
    	response = hs.URLAction("http://" & IP & "/command.json?command=clean","GET", "", "")
    	
    			If Debug = 2 Then 
    				hs.WriteLog("Thinking cleaner Start clean", response)
    			End If
    			
    	hs.WriteLog("Thinking cleaner Start clean", "success")
    	
    	End If ' errorcheck
    	End If
    	
    
    
    	'======================
    	'Spot
    	'======================
    	if scriptaction = "Spot" then
    	If errorflag = 0 Then 'errorcheck
    	
    	response = hs.URLAction("http://" & IP & "/command.json?command=spot","GET", "", "")
    	
    			If Debug = 2 Then 
    				hs.WriteLog("Thinking cleaner Spot Clean", response)
    			End If
    			
    	hs.WriteLog("Thinking cleaner Spot clean", "success")
    	
    	End If ' errorcheck
    	End If
    	
    	'======================
    	'FindMe
    	'======================
    	if scriptaction = "Findme" then
    	If errorflag = 0 Then 'errorcheck
    	
    	response = hs.URLAction("http://" & IP & "/command.json?command=find_me","GET", "", "")
    	
    			If Debug = 2 Then 
    				hs.WriteLog("Thinking cleaner Find Me", response)
    			End If
    			
    	hs.WriteLog("Thinking cleaner Find Me", "success")
    	
    	End If ' errorcheck
    	End If
    	
    end sub 'End Main routine
    
    
    
    '================================================================
    'Actions from device routine
    '================================================================
    
    Sub Actions(modeparams as object)
    	
    	Dim DevID As Integer = modeparams(0) 						'Integer - The device reference ID.
    	Dim ModeButton As String = modeparams(1)
    	
    	
    	hs.WriteLog("Thinkingcleaner", "Action requested by button press: " & ModeButton)
    	
    	If ModeButton = "Clean" Then
    		hs.RunScriptFunc("thinkingcleaner.vb", "Main", "Clean", True, False)
    	End If
    	
    	If ModeButton = "CleanMax" Then
    		hs.RunScriptFunc("thinkingcleaner.vb", "Main", "Maxclean", True, False)
    	End If
    	
    	If ModeButton = "Dock" Then
    		hs.RunScriptFunc("thinkingcleaner.vb", "Main", "Dock", True, False)
    	End If
    	
    	If ModeButton = "FindMe" Then
    		hs.RunScriptFunc("thinkingcleaner.vb", "Main", "Findme", True, False)
    	End If
    	
    	If ModeButton = "Spot" Then
    		hs.RunScriptFunc("thinkingcleaner.vb", "Main", "Spot", True, False)
    	End If
    	
    	
    	hs.RunScriptFunc("thinkingcleaner.vb", "Main", "", True, False)
    	
    End Sub ''End actions routine

    Leave a comment:


  • w.vuyk
    replied
    Glad this is solved!

    Wim

    Leave a comment:


  • bartbakels
    replied
    wim,

    great, added the full path to the scripting refrences which was looking just at the root, also rmoved the dll from the bin directory, and until now no errors.

    (needed to change one of my scripts)

    jowihue instaled without issues and strange log entrys

    thnks

    bart

    Leave a comment:

Working...
X