Gå til innhold
  • Bli medlem
Støtt hjemmeautomasjon.no!

Søk i nettsamfunnet

Viser resultater for emneknaggene 'vb'.

  • Søk etter emneknagger

    Skriv inn nøkkelord separert med kommaer.
  • Søk etter forfatter

Innholdstype


Kategorier

  • Generelt
    • Automasjonskaféen
    • Annen Elektronikk
    • Ditt system
    • Grafikk og design
    • Nettverk
    • Nybegynner
  • Leverandører
    • ELKO Smart
    • HeatIt
    • Namron
  • Bruksområder
    • A/V-kontroll
    • Belysning
    • Klimakontroll
    • Overvåking
    • Sikkerhet
    • Strømsparing og strøm-overvåkning
    • Talestyring
  • Systemer
    • Fibaro Home Center
    • Futurehome
    • Home Assistant
    • HomeKit
    • HomeSeer
    • Homey
    • Node-Red
    • openHAB
    • SmartThings
    • Øvrige systemer
  • Teknologi / Protokoller
    • Blåtann
    • irDA
    • KNX
    • Matter
    • Mikrokontrollere
    • MQTT
    • RF
    • xComfort
    • Z-Wave
    • ZigBee
  • Utlån, kjøp og salg
    • Prisjakt
    • Kjøp / Salg
    • Powerbuy
    • Kommersielle tilbud
    • Utlån
  • Nettstedet
    • Kunngjøringer
    • Nyheter
    • Ris, ros og spørsmål om forumet

Blogger

  • En teknologisk hverdag
  • Enda en hobby?
  • Smånytt
  • en guide til elektro-verdenen

Kategorier

  • Nyheter
    • Produkter
    • Programvare
  • Tester
    • Systemer
  • Guider
    • Fibaro
    • HomeSeer
    • Nettverk
    • openHAB
    • Z-Wave
    • ESP32

Finn resultater i...

Finn resultater som inneholder...


Startdato

  • Start

    Slutt


Sist oppdatert

  • Start

    Slutt


Filtrer etter antall...

Ble med

  • Start

    Slutt


Gruppe


System

Fant 2 resultater

  1. Bestilte ny smartbereder forrige lørdag. Det gjorde jeg på nettsidene til Varme & Bad som har fastpris på installasjon av Høiax Connected eks. elektriker. Tilbudet inkluderer også nedmontering og bortkjøring av gammel bereder, og prisen er kr 15 990,- for en Connected 200. Tilbudet ble oversendt per e-post mandag, og akseptert samme dag. Jeg fikk da tilbud om fastpris kr 3 000,- på elektrikerjobben gjennom samme firma, altså fakturert gjennom rørleggeren, noe jeg aksepterte. Onsdag ringte rørleggeren, og torsdag morgen var han på plass og monterte bereder. Et par timer etterpå var elektrikeren der og gjorde ferdig jobben. I dag kom faktura på avtalt pris, og jeg la inn anmodning om tilskudd hos Enova. Etter to timer var saken avgjort, og tilskuddet er på vei inn på konto i løpet av en ukes tid. Dette var en meget kjapp og behagelig prosess.
  2. Hei. Jeg har laget et script for å starte og parkere Gardena Smart Sileno gressklippere. Testet og fungerer på min Gardena Smart Sileno R100Li. Legg inn e-postadressen, passordet, og navnet på klipperen på linje 12->14 i skriptet. Sett logJson = True for å se alt i json-responsen fra Gardena. Det ligger mye nyttig informasjon i responsen fra get_device_id. Kall scriptet med parameter start eller stop. Disse parametrene blir så brukt lenger nede i scriptet til: 'Available start commands: 'Start according to schedule: "{""name"":""start_resume_schedule"", ""parameters"":{}}" 'Start overriding schedule. Run for 1440 minutes: "{""name"":""start_override_timer"", ""parameters"":{""duration"": 1440}}" 'Available stop commands: 'Park and pause all schedules: "{""name"":""park_until_further_notice""}" 'Park and start again at next schedule: "{""name"":""park_until_next_timer""}" Imports System.IO Imports System.Net '*** Choose if json-responces should get written to the log *** Const logJson As Boolean = False '************************************************************** Public Sub Main(ByVal command As String) '*** Put in e-mailadress and password and lawnmover-name *** '*** They must be exactly as entered into the Gardena app *** Dim email As String = "[email protected]" Dim password As String = "Mypassword" Dim mower_name As String = "Name_of_lawnmower_in_gardena_app" '************************************************* '*** NO NEED TO EDIT BEHIND THIS POINT! *** '************************************************* 'Get token and username Dim jsonGetToken As String = "{""sessions"":{""email"":""" & email & """,""password"":""" & password & """}}" Dim tokenAndUser() As String = getToken(jsonGetToken) 'Get location Dim location As String = getLocation(tokenAndUser) 'Get device-id for lawnmover set in mower_name Dim locationAndToken(3) as String locationAndToken(0) = tokenAndUser(0) locationAndToken(1) = location locationAndToken(2) = mower_name Dim deviceId As String = getdeviceId(locationAndToken) 'Send start or stop command to mower Dim data(4) as String data(0) = tokenAndUser(0) data(1) = location data(2) = deviceId data(3) = command sendCommand(data) End Sub Public Function getToken(json As string) As String() 'Get token and user ID based on e-mail and password Dim strURL As String = "https://sg-api.dss.husqvarnagroup.net/sg-1/sessions" Dim myWebReq As HttpWebRequest Dim myWebResp As HttpWebResponse Dim encoding As New System.Text.UTF8Encoding Dim sr As StreamReader Dim result(2) As String Try Dim data As Byte() = encoding.GetBytes(json) myWebReq = DirectCast(WebRequest.Create(strURL), HttpWebRequest) myWebReq.ContentType = "application/json" myWebReq.ContentLength = data.Length myWebReq.Method = "POST" Dim myStream As Stream = myWebReq.GetRequestStream() If data.Length > 0 Then myStream.Write(data, 0, data.Length) myStream.Close() End If myWebResp = DirectCast(myWebReq.GetResponse(), HttpWebResponse) sr = New StreamReader(myWebResp.GetResponseStream()) Dim responseText As String = sr.ReadToEnd() if logJson Then hs.WriteLog("Gardena", "Response getToken: " & responseText) End If 'Search json for token Dim sSource As String = responseText 'String that is being searched Dim sDelimStart As String = """token"":""" 'First delimiting word Dim sDelimEnd As String = """,""user_id" 'Second delimiting word Dim nIndexStart As Integer = sSource.IndexOf(sDelimStart) 'Find the first occurrence of f1 Dim nIndexEnd As Integer = sSource.IndexOf(sDelimEnd) 'Find the first occurrence of f2 If nIndexStart > -1 AndAlso nIndexEnd > -1 Then '-1 means the word was not found. Dim token As String = Strings.Mid(sSource, nIndexStart + sDelimStart.Length + 1, nIndexEnd - nIndexStart - sDelimStart.Length) 'Crop the text between hs.WriteLog("Gardena", "Token: " & token) 'We got the token, continue to get the user id sDelimStart = "user_id"":""" 'First delimiting word sDelimEnd = """,""refresh_token" 'Second delimiting word nIndexStart = sSource.IndexOf(sDelimStart) 'Find the first occurrence of f1 nIndexEnd = sSource.IndexOf(sDelimEnd) 'Find the first occurrence of f2 If nIndexStart > -1 AndAlso nIndexEnd > -1 Then '-1 means the word was not found. Dim user As String = Strings.Mid(sSource, nIndexStart + sDelimStart.Length + 1, nIndexEnd - nIndexStart - sDelimStart.Length) 'Crop the text between hs.WriteLog("Gardena", "User: " & user) result(0) = token result(1) = user return result Else hs.WriteLog("Gardena", "Error: Did not receive user ID") End If Else hs.WriteLog("Gardena", "Error: Did not receive token") End If Catch ex As Exception : hs.writelog("Gardena", "Error: " & ex.Message.ToString) End Try End Function Public Function getLocation(tokenAndUser() As String) As String 'Get location based on token and user id Dim token As String = tokenAndUser(0) Dim user As String = tokenAndUser(1) Dim strURL As String = "https://sg-api.dss.husqvarnagroup.net/sg-1/locations/?user_id=" & user Dim myWebReq As HttpWebRequest Dim myWebResp As HttpWebResponse Dim sr As StreamReader Try myWebReq = DirectCast(WebRequest.Create(strURL), HttpWebRequest) myWebReq.ContentType = "application/json" myWebReq.Method = "GET" myWebReq.Headers.Add("X-session", token) myWebResp = DirectCast(myWebReq.GetResponse(), HttpWebResponse) sr = New StreamReader(myWebResp.GetResponseStream()) Dim responseText As String = sr.ReadToEnd() if logJson Then hs.WriteLog("Gardena", "Response getLocation: " & responseText) End if 'Search json for location Dim sSource As String = responseText 'String that is being searched Dim sDelimStart As String = """id"":""" 'First delimiting word Dim sDelimEnd As String = """,""name" 'Second delimiting word Dim nIndexStart As Integer = sSource.IndexOf(sDelimStart) 'Find the first occurrence of f1 Dim nIndexEnd As Integer = sSource.IndexOf(sDelimEnd) 'Find the first occurrence of f2 If nIndexStart > -1 AndAlso nIndexEnd > -1 Then '-1 means the word was not found. Dim location As String = Strings.Mid(sSource, nIndexStart + sDelimStart.Length + 1, nIndexEnd - nIndexStart - sDelimStart.Length) 'Crop the text between hs.WriteLog("Gardena", "Location: " & location) return location Else hs.WriteLog("Gardena", "Error: Did not receive location") End If Catch ex As Exception : hs.writelog("Gardena", "Error: " & ex.Message.ToString) End Try End Function Public Function getdeviceId(tokenAndLocation() As String) As String 'Get device id for lawnmover based on location and mower_name Dim token As String = tokenAndLocation(0) Dim location As String = tokenAndLocation(1) Dim mower_name As String = tokenAndLocation(2) Dim strURL As String = "https://sg-api.dss.husqvarnagroup.net/sg-1/devices?locationId=" & location Dim myWebReq As HttpWebRequest Dim myWebResp As HttpWebResponse Dim sr As StreamReader Try myWebReq = DirectCast(WebRequest.Create(strURL), HttpWebRequest) myWebReq.ContentType = "application/json" myWebReq.Method = "GET" myWebReq.Headers.Add("X-session", token) myWebResp = DirectCast(myWebReq.GetResponse(), HttpWebResponse) sr = New StreamReader(myWebResp.GetResponseStream()) Dim responseText As String = sr.ReadToEnd() if logJson Then hs.WriteLog("Gardena", "Response getLocation: " & responseText) End If 'Finn Device ID Dim sSource As String = responseText 'String that is being searched Dim sDelimEnd As String = """,""name"":""" & mower_name & """,""category"":""mower""" 'Second delimiting word Dim nIndexStart As Integer = sSource.IndexOf(sDelimEnd) - 36 Dim nIndexEnd As Integer = sSource.IndexOf(sDelimEnd) 'Find the first occurrence of f2 If nIndexStart > -1 AndAlso nIndexEnd > -1 Then '-1 means the word was not found. Dim deviceId As String = Strings.Mid(sSource, nIndexStart + 1, nIndexEnd - nIndexStart) 'Crop the text between hs.WriteLog("Gardena", "Device ID: " & deviceId) return deviceId Else hs.WriteLog("Gardena", "Error: Did not receive device ID") End If Catch ex As Exception : hs.writelog("Gardena", "Error: " & ex.Message.ToString) End Try End Function Public Function sendCommand(data() As String) 'Send start or stop to the mower. Dim token As String = data(0) Dim location As String = data(1) Dim device As String = data(2) Dim command As String = data(3) Dim json As String '*** Here you can change what start and stop does.*** 'Available start commands: 'Start according to schedule: "{""name"":""start_resume_schedule"", ""parameters"":{}}" 'Start overriding schedule. Run for 1440 minutes: "{""name"":""start_override_timer"", ""parameters"":{""duration"": 1440}}" 'Available stop commands: 'Park and pause all schedules: "{""name"":""park_until_further_notice""}" 'Park and start again at next schedule: "{""name"":""park_until_next_timer""}" if command = "start" Then json = "{""name"":""start_resume_schedule"", ""parameters"":{}}" else if command = "stop" Then json = "{""name"":""park_until_further_notice""}" else hs.writelog("Gardena", "Error: Angi start eller stop som parameter") End If Dim strURL As String = "https://sg-api.dss.husqvarnagroup.net/sg-1/devices/" & device & "/abilities/mower/command?locationId=" & location Dim myWebReq As HttpWebRequest Dim myWebResp As HttpWebResponse Dim encoding As New System.Text.UTF8Encoding Dim sr As StreamReader Try Dim data As Byte() = encoding.GetBytes(json) myWebReq = DirectCast(WebRequest.Create(strURL), HttpWebRequest) myWebReq.ContentType = "application/json" myWebReq.ContentLength = data.Length myWebReq.Headers.Add("X-session", token) myWebReq.Method = "POST" Dim myStream As Stream = myWebReq.GetRequestStream() If data.Length > 0 Then myStream.Write(data, 0, data.Length) myStream.Close() End If myWebResp = DirectCast(myWebReq.GetResponse(), HttpWebResponse) sr = New StreamReader(myWebResp.GetResponseStream()) Dim responseText As String = sr.ReadToEnd() hs.WriteLog("Gardena", "Sent command: " & command) Catch ex As Exception : hs.writelog("Gardena", "Error: " & ex.Message.ToString) End Try End Function
  • Medlemsstatistikk

    6 973
    Totalt antall medlemmer
    1 891
    Flest pålogget
    steff95
    Nyeste medlem
    steff95
    Ble med
×
×
  • Opprett ny...

Viktig informasjon

Vi har plassert informasjonskapsler/cookies på din enhet for å gjøre denne siden bedre. Du kan justere dine innstillinger for informasjonskapsler, ellers vil vi anta at dette er ok for deg.