Freut mich - und ich kann wieder gut schlafen!
![]()
Freut mich - und ich kann wieder gut schlafen!
![]()
HM per CCU2 + LAN-Adapter am RasPi | Youless | Hydreon RG-11 | SONOS 2xPlay:1, 1xPlay:5, 3xConnect:AMP | eBus
Hallo alle zusammen,
Das Beispiel aus Post #10 hat die Wende für meinen Tingbot gebracht!
Besten Dank!!!!
Bis dann
Martin
ich hole das mal wieder nach obe.
nutze hier auch die rpc schnittstelle.
SetValue funktioniert bei mir tadellos.
Allderdings weiß ich nicht wie ich Werte ausgelesen bekomme...
Folgendes Script:
#!/usr/bin/env python
import time
import requests
import json
from pyquery import PyQuery
from pyA20.gpio import gpio
from pyA20.gpio import port
from pyA20.gpio import connector
def IPSrpc(methodIps, paramIps):
url = "http://**************@172.16.50.10:3777/api/"
headers = {'content-type': 'application/json'}
payload = {
"method": methodIps,
"params": paramIps,
"jsonrpc": "2.0",
"id": "0",
}
response = requests.post(url, data=json.dumps(payload), headers=headers)
c = IPSrpc("GetValue", [55624])
print c
die überflüssigen imports sind drin, da dies nur ein testscript ist...
ausgabe ist bei mit immer "None"
hat da jemand eine idee?
Geändert von paresy (01.12.17 um 13:21 Uhr)
Hallo,
Absicht, dass du das Passwort mit gepostet hast?
Vielleicht solltest du das "ausblenden"? Auch wenn es nur lokal ist. (Ich weiß ja nicht, ob du es noch wo anders nutzt!)
Grüße,
Kai
IPS 5.2, auf Tinkerboard und RPI, piVCCU, Homematic & Homematic IP, diverse Tasmota Geräte, Shelly, GHoma, LG HomBot, Sonos, Tvheadend, HomeKit, AppleTV
Einfach mal rein schauen: IP-Symcon Discord Channel
äh ja ^^ ist nur local
aber wieso gibt es hier keinen edit Button?!?
Du benötigst 25 Beiträge zum editieren, diese Regel wurde aufgrund von Spam Nachrichten eingeführt. (IP-Symcon Community Forum)
Grüße,
Kai
IPS 5.2, auf Tinkerboard und RPI, piVCCU, Homematic & Homematic IP, diverse Tasmota Geräte, Shelly, GHoma, LG HomBot, Sonos, Tvheadend, HomeKit, AppleTV
Einfach mal rein schauen: IP-Symcon Discord Channel
Ich habe das Passwort entfernt.
paresy
Hallo Zusammen,
Ich versuche auch schon seit längerem dies wieder hinzubekommen, leider geht dies nicht mehr.
Bekomme immer folgede fehlermeldung:
Wer hat eine Idee?PHP-Code:
{"jsonrpc": "2.0", "params": [12349, 12.9], "method": "SetValue", "id": "0"}
<bound method Response.json of <Response [401]>>
Danke, Wolfgang
Windows Home Server,Raspberry, Siemens S7 mit Profibus+Profinet, Siemens Sentron, Siemens LOGO, EZ Control XS1, Webcams, SMS USB Gateway, Viessmann Heizung, Alexa, ...
Hallo Zusammen,
Ich konnte das Problem lösen, Ich musste nur die Authentifizierung nochmals mitsenden:
PHP-Code:
# notwendige Module importieren
import time
import requests
import json
from requests.auth import HTTPBasicAuth
# JSON-RPS zu IPS definieren
def IpsRpc(methodIps, paramIps):
url = "http://oe2swm.ddns.net:3777/api/"
auth=HTTPBasicAuth('**USER**', '**pass**')
headers = {'content-type': 'application/json'}
payload = {
"method": methodIps,
"params": paramIps,
"jsonrpc": "2.0",
"id": "0",
}
print json.dumps(payload)
response = requests.post(url, data=json.dumps(payload), headers=headers, auth=auth).json
print(response)
IpsRpc("SetValue", [12349, 12.5]) # 10900 = zu aktualisierende IPS-Variablen-ID, key = zu sendender Wert
Geändert von paresy (18.07.19 um 08:20 Uhr)
Windows Home Server,Raspberry, Siemens S7 mit Profibus+Profinet, Siemens Sentron, Siemens LOGO, EZ Control XS1, Webcams, SMS USB Gateway, Viessmann Heizung, Alexa, ...