Hello,
Running on a Shelly Pro 1PM with firmware 1.11 (20220830-131534/0.11.0-gfa1bc37), I gave KVS a try.
I have noticed several times, where all KVS variables were lost:
$ curl -s 'http://$SHELLY/rpc/KVS.List' | jq .
{
"keys": {
"scripts-library": {
"etag": "64qBCCQKaC"
}
},
"rev": 35
}
I have identified two cases where it happens:
* The 1st one, when doing some tests I've made a syntax error inside the callback function of a KVS.Get call. The script has crashed (that's normal) but all the KVS storage was voided immediately after. only the rev field was kept.
Shelly.call (
"KVS.Get"
{ key: "pool_temp" },
function (result) {
if (result) {
print("[TEST] KVS Get: ", JSON.stringify(resul.value)); // typo
}
else {
print("[TEST] KVS Get: (null)");
}
}
);
Alles anzeigen
* The 2nd one has happened this night, the house has suffered a power outage during a storm. Once Shelly was back to life, all KVS storage was empty.
If it can help, here the script I'm currently running:
https://git.grandou.net/gilles/shelly_…ch/main/pool.js
* 2 KVS.Get calls are performed on startup
* 1 KVS.Set upon a new temperature change from a mqtt message, a few times per day
* 2 KVS Set after midnight
Thanks for any hint to improve reliabilty