Domòtica / Home automation
|
Index
|
|
|
|
|
|
|
|
|
|
|
|
|
- Efergy
- Shelly (es)
- Control remot
- GitHub
- Shelly Cloud
- Devices
- Installation guides
- Application guide
- Web interface guides
- Integració amb Google Home
- Relés
- Shelly Technical Documentation
- Scripts
- Gen
2 Device API
- Devices
- General
- RPC
Protocol
- RPC Channels
-
|
|
url |
example |
HTTP
|
POST request with entire frame as
payload |
/rpc |
export SHELLY=192.168.1.142
curl
-X POST -d
'{"id":1,"method":"Shelly.GetStatus"}'
http://${SHELLY}/rpc |
POST request with args only |
/rpc/<method_name> |
curl
-X POST -d '{"id":1}'
http://${SHELLY}/rpc/Shelly.GetStatus
|
GET with query string |
/rpc/<method_name> |
curl
-X GET -d '{"id":1}'
http://${SHELLY}/rpc/Shelly.GetStatus
|
WebSocket |
JSON-RPC
|
/rpc |
CLI:
wscat -c
ws://${SHELLY}/rpc {...}
- websocat
ws://${SHELLY}/rpc
- {"method":"shelly.getstatus","id":0,
"src": "1234"}
Language
- (JavaScript)
- websockets
from
websockets.sync.client
import connect
def get_status():
with
connect("ws://192.168.1.142/rpc")
as websocket:
websocket.send('{"method":"shelly.getstatus",
"id":0, "src":"1234"}')
message = websocket.recv()
print(f"Received:
{message}")
get_status()
- #
https://stackoverflow.com/questions/55755401/how-to-run-forever-async-websocket-client
import asyncio
import websockets
async def notifications():
async
with
websockets.connect("ws://192.168.1.142/rpc")
as websocket:
await
websocket.send('{"method":"shelly.getstatus","id":0,"src":"1234"}')
message = await
websocket.recv()
print(f"Received:
{message}")
while True:
notification = await
websocket.recv()
print(f"Notification:
{notification}")
if __name__ == "__main__":
asyncio.get_event_loop().run_until_complete(notifications())
- aioshelly
- python
example.py -ip
192.168.1.142 -i
- jsonrpc_websocket
- import
asyncio
from jsonrpc_websocket
import Server
async def routine():
server
=
Server('ws://192.168.1.142/rpc')
try:
await server.ws_connect()
response = await
server.shelly.getstatus()
print(response)
finally:
await server.close()
asyncio.get_event_loop().run_until_complete(routine())
|
MQTT
|
topic for publishing requests |
<shelly-id>/rpc |
export
MQTT_SERVER="broker.hivemq.com"
export MQTT_PORT=1883
mosquitto_pub
-h ${MQTT_SERVER} -p ${MQTT_PORT}
-t shellyplus1-c4dd57877294/rpc \
-m '{"id":123,
"src":"user_1",
"method":"Switch.Set",
"params":{"id":0,"on":true}}'
|
topic for response |
<src>/rpc |
mosquitto _sub
-h ${MQTT_SERVER} -p ${MQTT_PORT}
-t user_1/rpc
|
topic for notifications |
<shelly-id>/events/rpc |
mosquitto _sub
-h ${MQTT_SERVER} -p ${MQTT_PORT}
-t
shellypro4pm-f008d1d8b8b8/events/rpc
|
topic for online status |
<shelly-id>/online |
|
UDP |
|
|
mos
call --port
udp://192.168.11.5:1234/
Shelly.GetStatus |
- Component
Concept
-
Status |
|
Configuration |
<component>.GetConfig
<component>.SetConfig
|
- Notifications
- Common Errors
-
|
|
-103 |
INVALID ARGUMENT |
-104 |
DEADLINE EXCEEDED |
-108 |
RESOURCE EXHAUSTED |
-109 |
FAILED PRECONDITION |
-114 |
UNAVAILABLE |
- Gen1 Compatibility
- mDNS
- Authentication
- SSL support for outbound connections
- Sleep
management for battery-operated devices
- Debug
Logs
- Safe
Mode
- Components
and services
|
|
|
Shelly |
- Shelly.GetStatus
curl -X POST -d
'{"id":1,"method":"Shelly.GetStatus"}'
http://${SHELLY}/rpc
- Shelly.GetConfig
curl -X POST -d
'{"id":1,"method":"Shelly.GetConfig"}'
http://${SHELLY}/rpc
|
- Shelly.ListMethods
curl -X POST -d
'{"id":1,"method":"Shelly.ListMethods"}'
http://${SHELLY}/rpc
- Shelly.GetDeviceInfo
curl -X POST -d
'{"id":1,"method":"Shelly.GetDeviceInfo"}'
http://${SHELLY}/rpc
curl http://${SHELLY}/shelly
- ...
|
Schedule |
|
|
Webhook |
|
|
HTTP |
|
|
KVS |
|
|
System |
|
|
WiFi |
|
|
Ethernet |
|
|
Bluetooth Low Energy |
|
|
Cloud |
|
|
MQTT |
|
|
Outbound Websocket |
|
|
Script |
|
|
Input |
|
|
Modbus |
|
|
Voltmeter |
|
|
Cover |
|
|
Switch |
|
|
Light |
|
|
DevicePower |
|
|
Humidity |
|
|
Temperature |
|
|
EM |
|
|
EMData |
|
|
Smoke |
|
|
- ...
- ...
- ...
- Plafons / Panels
- Rellotge
- GSM DIN-3
- Philips
Hue
- Techology
- Philips Hue starter kit
- 3x bombetes hue E27 9W
- 1x bridge
- Preus
- Hue developer
program
- Apps4hue
- Rocrail
- SDK
- bash
- lampe
- GTK
- Install
- Mageia
urpmi vala
lib64gtk+3.0-devel
lib64json-glib-devel redshift-gtk
git clone
https://github.com/poinck/lampe.git
cd lampe
make
make install
sudo lampe
sudo lampe-gtk
|
|
|
|
|
Passarel·la / Gateway
|
|
|
|
|
nom |
fundadors |
empreses |
OSI |
bps |
suport |
TP |
coax |
FO |
net |
PL |
RF |
IR |
X10 |
picoElectronics |
|
|
50/60 |
|
|
|
|
x |
|
|
HES |
IEC/ISO JTC1 SC25 WG1 |
|
|
|
|
|
|
|
|
|
|
KNX |
EIB |
|
- ABB i-bus
- Berker
- Busch-Jaeger
- Gira
- Grasslin
- Hager
- Jung (Instabus)
- Lingg-Janke
- Merten
- Moeller
- Siemens
- Sigma
- Theben
|
1,2,3,4,7 |
|
9,6k (TP1) |
|
|
x |
x (PL100) |
x |
x |
BatiBus |
- Merlin-Gerin
- Airetec
- Landis & Gyr
|
|
1,2,7 |
|
4,8k (TP0) |
|
|
|
|
|
|
EHS |
|
|
1,2,3,7 |
|
TP0: 4,8k,
TP1: 9,6k,
TP2: 64k |
|
|
|
PL2400: 2,4k (PL132) |
RF-1100: 1,1k |
IR-1200: 1,2k |
CEBus |
- EIA
- CIC (IBM, Honeywell, Microsoft, Panasonic, Sony)
|
|
1,2,3,7 |
7,5k |
x |
x |
x |
|
x |
x |
x |
Lonworks |
|
|
1,2,3,4,5,6,7 LonTalk |
|
LPT10: 78k, TP1250:1,2M |
x |
x |
|
x |
x |
|
BACNet |
|
- Andover
- Autom. Logic
- Delta Controls
- Honeywell
- Siemens
|
802.3, ARCNET, LonTalk |
|
|
|
|
|
|
|
|
SCP |
- Microsoft
- General Electric
|
|
CEbus (UPnP) |
|
|
|
|
|
|
|
|
Echonet |
|
|
|
|
|
|
|
|
|
|
|
Zigbee |
|
|
|
|
|
|
|
|
|
|
|
|
|
- HAVi
- Grundig
- Hitachi
- Panasonic
- Philips
- Sharp
- Sony
- Thomson
- Toshiba
- UPnP
- Jini
|
http://www.francescpinyol.cat/domotica.html
Darrera modificació: 16 de desembre de 2023 / Last update: 16th
December 2023
Cap a casa / Back home. |