Ver código fonte

feature: added Shelly Gen2 API to example (e.g. for ShellyPlugS)

Volker Tanger 7 meses atrás
pai
commit
776c6f3305
3 arquivos alterados com 10 adições e 2 exclusões
  1. 1 1
      functions.moshel
  2. 4 0
      history.txt
  3. 5 1
      moshel.example

+ 1 - 1
functions.moshel

@@ -8,7 +8,7 @@
 #
 #!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 
-MOSHELVERSION="2.1.3"
+MOSHELVERSION="2.1.4"
 
 #---------------------------------------------------------
 # init library and files

+ 4 - 0
history.txt

@@ -66,6 +66,10 @@ wanted checks (examples)
 
 ------------------------------------------------------------------------
 
+2024-05-08
+    Volker Tanger <volker.tanger@wyae.de>
+	* feature: added Shelly Gen2 API to example (e.g. for ShellyPlugS)
+	
 2024-05 onward
 	re-licensed unter EUPL v1.2
 

+ 5 - 1
moshel.example

@@ -193,10 +193,14 @@ fgrep 'MATCH_SENSOR_STRING' /var/log/rtl_433.log \
 CheckValueUnder AirHumidity "cat $FN" '$0' 100 'Sensor broken?'
 
 
-# retrieve power usage/solar generation from a Shelly PM
+# retrieve power usage/solar generation from a Shelly (Gen1-API)
 curl --max-time 5 -s -u USER:PASSWORD --basic http://IPADDRESS/status | jq '.meters[0].power' > $FN
 CheckValueUnder Solarstrom-Shelly1pm "cat $FN" '{ print $0 }' 6350 'Solar generation above 600W'
 
+# retrieve power usage/solar generation from a ShellyPlugS (Gen2-API)
+curl --max-time 5 -s -u USER:PASSWORD --anyauth 'http://IPADDRESS/rpc/Switch.GetStatus?id=0' | jq .apower > $FN
+CheckValueUnder Solarstrom-ShellyPlugS "cat $FN" '{ print $0 }' 6350 'Solar generation above 600W'
+
 rm $FN