Announcement

Collapse
No announcement yet.

errors updating to 1.6.4

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

    #16
    I renamed the Newtonsoft in \bin, reinstalled the original .config (before all changes) and rebooted HS.

    Now i get erros about not beeing in the active interfaces list.

    It looks like its my Sensorist Cloud connector plugin that uses the Newtonsoft in \bin. I will tell Nicolai.

    Right now things are not good. I will have to fiddle a bit.
    Last edited by mhn; October 2, 2015, 04:09 PM.

    Comment


      #17
      Disable Sensorist Cloud connector seem to remove all errors.

      I will contact Nicolai.

      Comment


        #18
        Originally posted by mhn View Post
        I renamed the Newtonsoft in \bin, reinstalled the original .config (before alle changes) and rebooted HS.

        Now i get erros about not beeing in the active interfaces list.

        It looks like its my Sensorist Cloud connestor plugin that uses the Newtonsoft in \bin. I will tell Nicoali.

        Right now things are not good. I will have to fiddle a bit.
        It would be nice if Bart could also confirm he is using the mysensors plugin.

        The easiest for you to get back to running again might be restoring the 'old' plugin and restore the newtonsoft dll for the mysonsors plugin. Make sure to also restore the old newtonsoft dll for jowihue...

        Thanks a lot for helping me to find possible causes!

        Wim
        -- Wim

        Plugins: JowiHue, RFXCOM, Sonos4, Jon00's Perfmon and Network monitor, EasyTrigger, Pushover 3P, rnbWeather, BLBackup, AK SmartDevice, Pushover, PHLocation, Zwave, GCalseer, SDJ-Health, Device History, BLGData

        1210 devices/features ---- 392 events ----- 40 scripts

        Comment


          #19
          It's not MySensors it's Sensorist plugin. :-)

          The problem must be the Newtonsoft in bin whichever plugin place it there.

          I will live without the Sensorist plugin until I can get Nicolai to fix it. It's just the temperatures in my fridge, freezer and wine. :-)

          Regards
          Morten

          Comment


            #20
            Or I could make a quick and dirty .config for Sensorist plugin. It seems to work fine. :-)

            The Mediacontroller plugin acts strange too. So it might be a problem. I just disabled it for now. I don't use it.

            Regards
            Morten

            Comment


              #21
              Oops, overlooked on that one....

              Wim
              -- Wim

              Plugins: JowiHue, RFXCOM, Sonos4, Jon00's Perfmon and Network monitor, EasyTrigger, Pushover 3P, rnbWeather, BLBackup, AK SmartDevice, Pushover, PHLocation, Zwave, GCalseer, SDJ-Health, Device History, BLGData

              1210 devices/features ---- 392 events ----- 40 scripts

              Comment


                #22
                Originally posted by mhn View Post
                Or I could make a quick and dirty .config for Sensorist plugin. It seems to work fine. :-)

                The Mediacontroller plugin acts strange too. So it might be a problem. I just disabled it for now. I don't use it.

                Regards
                Morten
                Strange as in throwing json errors?

                Wim
                -- Wim

                Plugins: JowiHue, RFXCOM, Sonos4, Jon00's Perfmon and Network monitor, EasyTrigger, Pushover 3P, rnbWeather, BLBackup, AK SmartDevice, Pushover, PHLocation, Zwave, GCalseer, SDJ-Health, Device History, BLGData

                1210 devices/features ---- 392 events ----- 40 scripts

                Comment


                  #23
                  As in not being in the interface list errors in plugins - manage.

                  Comment


                    #24
                    I just enabled Mediacontroller because we need to know. :-)

                    It seems to work now. I don't think it has anything to do with this error. But it followed the errors from the other plugins for some reason? :-|

                    Comment


                      #25
                      sorry wim,

                      I forgot to enable notifications :O,

                      I will try tonight, however, when i manually removed the newtonsoft.dll from the hs3 root, i got more errros, not only for jowihue, but also some of my scripts are dependend on this dll in the hs3 root.

                      I added the newtonsoft dll also to the hs3 config file.

                      What exactly do you want me to test wim? BTW i still got a newtonsoft dll in the HS3 root, bin root and bin/jowihue root, I want to get rid of the one in hs3 root and bin root.

                      Bart
                      Regards Bart
                      ------------------------------------------
                      Win7 64Bit on Intel NUCI7 with SSD
                      HSPRO 3.
                      Devices; 1370 Events; 691

                      Jon00 Scripts, JowHue, HSTouch, Plugwise, Z-wave, Ultranetatmo, Ultracam, PHlocation, BLUSBUIRT, MeiHarmony, Buienradar, MEiUnifi Pushover 3P, Random, Nest HSPhone and Blueiris

                      Visonic Powermax Alarm System (HS3) Interface: http://www.domoticaforum.eu/viewtopic.php?f=68&t=11129

                      Comment


                        #26
                        Bart,

                        Putting dll's in the hs3 root should not be done, neither for plugins as well es scripts. If you need a dll for your scripts you should put it in a subdirectory under the bin and make sure your settings.ini is pointing to it like:

                        ScriptingReferences=System.Data.SQLite;c:\hs3\bin\Barts\System.Data.SQLite.dll (c:\hs3\ pointing to your own installation directory of course)

                        Or - when there is already a ScriptingReferences entry, append to it with a comma in front.

                        That way if any script or plugin needs to change version, it will not be in the way of other stuff.
                        Once you made this change, it should be ok again.

                        Thanks,

                        Wim
                        -- Wim

                        Plugins: JowiHue, RFXCOM, Sonos4, Jon00's Perfmon and Network monitor, EasyTrigger, Pushover 3P, rnbWeather, BLBackup, AK SmartDevice, Pushover, PHLocation, Zwave, GCalseer, SDJ-Health, Device History, BLGData

                        1210 devices/features ---- 392 events ----- 40 scripts

                        Comment


                          #27
                          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
                          Regards Bart
                          ------------------------------------------
                          Win7 64Bit on Intel NUCI7 with SSD
                          HSPRO 3.
                          Devices; 1370 Events; 691

                          Jon00 Scripts, JowHue, HSTouch, Plugwise, Z-wave, Ultranetatmo, Ultracam, PHlocation, BLUSBUIRT, MeiHarmony, Buienradar, MEiUnifi Pushover 3P, Random, Nest HSPhone and Blueiris

                          Visonic Powermax Alarm System (HS3) Interface: http://www.domoticaforum.eu/viewtopic.php?f=68&t=11129

                          Comment


                            #28
                            Glad this is solved!

                            Wim
                            -- Wim

                            Plugins: JowiHue, RFXCOM, Sonos4, Jon00's Perfmon and Network monitor, EasyTrigger, Pushover 3P, rnbWeather, BLBackup, AK SmartDevice, Pushover, PHLocation, Zwave, GCalseer, SDJ-Health, Device History, BLGData

                            1210 devices/features ---- 392 events ----- 40 scripts

                            Comment


                              #29
                              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
                              Regards Bart
                              ------------------------------------------
                              Win7 64Bit on Intel NUCI7 with SSD
                              HSPRO 3.
                              Devices; 1370 Events; 691

                              Jon00 Scripts, JowHue, HSTouch, Plugwise, Z-wave, Ultranetatmo, Ultracam, PHlocation, BLUSBUIRT, MeiHarmony, Buienradar, MEiUnifi Pushover 3P, Random, Nest HSPhone and Blueiris

                              Visonic Powermax Alarm System (HS3) Interface: http://www.domoticaforum.eu/viewtopic.php?f=68&t=11129

                              Comment


                                #30
                                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

                                Plugins: JowiHue, RFXCOM, Sonos4, Jon00's Perfmon and Network monitor, EasyTrigger, Pushover 3P, rnbWeather, BLBackup, AK SmartDevice, Pushover, PHLocation, Zwave, GCalseer, SDJ-Health, Device History, BLGData

                                1210 devices/features ---- 392 events ----- 40 scripts

                                Comment

                                Working...
                                X