Shelly Device Handlers for Hubitat

Setings

Ok Sending logs

Parent

dev:322023-05-22 12:22:42.006info(null meter 1 Phase C) Meter generic report: Electric:voltage 229.8V

dev:322023-05-22 12:22:41.987info(null meter 1 Phase B) Meter generic report: Electric:voltage 237.1V

dev:322023-05-22 12:22:41.973info(null meter 1 Phase A) Meter generic report: Electric:voltage 235.9V

dev:322023-05-22 12:22:41.958info(null meter 1 Phase C) Meter generic report: Electric:powerFactor -1.0cos(φ)

dev:322023-05-22 12:22:41.945info(null meter 1 Phase B) Meter generic report: Electric:powerFactor -1.0cos(φ)

dev:322023-05-22 12:22:41.932info(null meter 1 Phase A) Meter generic report: Electric:powerFactor -1.0cos(φ)

dev:322023-05-22 12:22:41.919info(null meter 1 Total) Meter generic report: Electric:amperage 23.722A

dev:322023-05-22 12:22:41.906info(null meter 1 Phase C) Meter generic report: Electric:amperage 7.967A

dev:322023-05-22 12:22:41.894info(null meter 1 Phase B) Meter generic report: Electric:amperage 7.877A

dev:322023-05-22 12:22:41.881info(null meter 1 Phase A) Meter generic report: Electric:amperage 7.879A

dev:322023-05-22 12:22:41.866info(null meter 1 Total) Meter generic report: Electric:power 5546.142W

dev:322023-05-22 12:22:41.850info(null meter 1 Phase C) Meter generic report: Electric:power 1826.2W

dev:322023-05-22 12:22:41.832info(null meter 1 Phase B) Meter generic report: Electric:power 1865.3W

dev:322023-05-22 12:22:41.813info(null meter 1 Phase A) Meter generic report: Electric:power 1854.7W

dev:322023-05-22 12:22:41.809info([null meter 1 Phase A, null meter 1 Phase B, null meter 1 Phase C, null meter 1 Total]) parseShellyEnergyMeterStatus [a_act_power:1854.7, b_aprt_power:1867.6, b_act_power:1865.3, total_current:23.722, n_current:null, total_act_power:5546.142, a_voltage:235.9, c_current:7.967, b_current:7.877, a_current:7.879, b_voltage:237.1, a_aprt_power:1857.9, c_voltage:229.8, a_pf:-1.00, c_aprt_power:1829.6, total_aprt_power:5555.125, id:0, c_pf:-1.00, b_pf:-1.00, c_act_power:1826.2]

dev:322023-05-22 12:22:40.210infoparseShellyWifiStatus [rssi:0, sta_ip:null, ssid:null, status:connecting]

dev:322023-05-22 12:22:40.204infoNotifyEvent event [reason:201, component:wifi, event:sta_connect_fail, ts:1684750958.92]

dev:322023-05-22 12:22:38.978info(null meter 1 Phase C) Meter generic report: Electric:voltage 229.7V

dev:322023-05-22 12:22:38.965info(null meter 1 Phase B) Meter generic report: Electric:voltage 237.0V

dev:322023-05-22 12:22:38.952info(null meter 1 Phase A) Meter generic report: Electric:voltage 235.9V

dev:322023-05-22 12:22:38.938info(null meter 1 Phase C) Meter generic report: Electric:powerFactor -1.0cos(φ)

dev:322023-05-22 12:22:38.925info(null meter 1 Phase B) Meter generic report: Electric:powerFactor -1.0cos(φ)

dev:322023-05-22 12:22:38.912info(null meter 1 Phase A) Meter generic report: Electric:powerFactor -1.0cos(φ)

dev:322023-05-22 12:22:38.899info(null meter 1 Total) Meter generic report: Electric:amperage 23.77A

dev:322023-05-22 12:22:38.885info(null meter 1 Phase C) Meter generic report: Electric:amperage 7.983A

dev:322023-05-22 12:22:38.872info(null meter 1 Phase B) Meter generic report: Electric:amperage 7.894A

dev:322023-05-22 12:22:38.860info(null meter 1 Phase A) Meter generic report: Electric:amperage 7.893A

dev:322023-05-22 12:22:38.847info(null meter 1 Total) Meter generic report: Electric:power 5556.454W

dev:322023-05-22 12:22:38.833info(null meter 1 Phase C) Meter generic report: Electric:power 1829.1W

dev:322023-05-22 12:22:38.820info(null meter 1 Phase B) Meter generic report: Electric:power 1869.4W

dev:322023-05-22 12:22:38.807info(null meter 1 Phase A) Meter generic report: Electric:power 1858.0W

dev:322023-05-22 12:22:38.804info([null meter 1 Phase A, null meter 1 Phase B, null meter 1 Phase C, null meter 1 Total]) parseShellyEnergyMeterStatus [a_act_power:1858.0, b_aprt_power:1871.3, b_act_power:1869.4, total_current:23.770, n_current:null, total_act_power:5556.454, a_voltage:235.9, c_current:7.983, b_current:7.894, a_current:7.893, b_voltage:237.0, a_aprt_power:1861.4, c_voltage:229.7, a_pf:-1.00, c_aprt_power:1832.6, total_aprt_power:5565.286, id:0, c_pf:-1.00, b_pf:-1.00, c_act_power:1829.1]

Child TOTAL

dev:422023-05-22 12:27:24.874infoGeneric Component Energy Meter: amperage change is below threshold. Threshold 1 but delta is 0.22500090026855446; skipping event

dev:422023-05-22 12:27:24.820infoGeneric Component Energy Meter: power change is below threshold. Threshold 50 but delta is 6.3590429687501455; skipping event

dev:422023-05-22 12:27:21.875infoGeneric Component Energy Meter: amperage change is below threshold. Threshold 1 but delta is 0.22500090026855446; skipping event

dev:422023-05-22 12:27:21.820infoGeneric Component Energy Meter: power change is below threshold. Threshold 50 but delta is 6.3932226562501455; skipping event

dev:422023-05-22 12:27:18.874infoGeneric Component Energy Meter: amperage change is below threshold. Threshold 1 but delta is 0.1999993743896482; skipping event

dev:422023-05-22 12:27:18.820infoGeneric Component Energy Meter: power change is below threshold. Threshold 50 but delta is 12.465000000000146; skipping event

dev:422023-05-22 12:27:14.874infoGeneric Component Energy Meter: amperage change is below threshold. Threshold 1 but delta is 0.14799932861328102; skipping event

dev:422023-05-22 12:27:14.820infoGeneric Component Energy Meter: power change is below threshold. Threshold 50 but delta is 23.417148437500146; skipping event

dev:422023-05-22 12:27:11.874infoGeneric Component Energy Meter: amperage change is below threshold. Threshold 1 but delta is 0.1660008850097654; skipping event

dev:422023-05-22 12:27:11.819infoGeneric Component Energy Meter: power change is below threshold. Threshold 50 but delta is 17.395175781250146; skipping event

dev:422023-05-22 12:27:10.371infoGeneric Component Energy Meter: amperage change is below threshold. Threshold 1 but delta is 0.18400053405761696; skipping event

dev:422023-05-22 12:27:10.317infoGeneric Component Energy Meter: power change is below threshold. Threshold 50 but delta is 13.273105468750146; skipping event

dev:422023-05-22 12:27:10.166infoGeneric Component Energy Meter: amperage change is below threshold. Threshold 1 but delta is 0.24499945068359352; skipping event

dev:422023-05-22 12:27:10.112infoGeneric Component Energy Meter: power change is below threshold. Threshold 50 but delta is 2.0690039062501455; skipping event

dev:422023-05-22 12:27:02.149infoGeneric Component Energy Meter: amperage change is below threshold. Threshold 1 but delta is 0.38900045776367165; skipping event

dev:422023-05-22 12:27:02.096infoGeneric Component Energy Meter: power change is below threshold. Threshold 50 but delta is 33.258144531249854; skipping event

dev:422023-05-22 12:27:01.916infoElectric 145.94014kWh

dev:422023-05-22 12:26:58.877infoGeneric Component Energy Meter: amperage change is below threshold. Threshold 1 but delta is 0.355000061035156; skipping event

dev:422023-05-22 12:26:58.823infoGeneric Component Energy Meter: power change is below threshold. Threshold 50 but delta is 24.829921874999854; skipping event

dev:422023-05-22 12:26:55.877infoGeneric Component Energy Meter: amperage change is below threshold. Threshold 1 but delta is 0.21900038146972634; skipping event

dev:422023-05-22 12:26:55.824infoGeneric Component Energy Meter: power change is below threshold. Threshold 50 but delta is 4.8277929687501455; skipping event

dev:422023-05-22 12:26:52.878infoGeneric Component Energy Meter: amperage change is below threshold. Threshold 1 but delta is 0.10299925231933571; skipping event

dev:422023-05-22 12:26:52.824infoGeneric Component Energy Meter: power change is below threshold. Threshold 50 but delta is 34.503085937500146; skipping event

dev:422023-05-22 12:26:48.880infoGeneric Component Energy Meter: amperage change is below threshold. Threshold 1 but delta is 0.07300047302246071; skipping event

dev:422023-05-22 12:26:48.826infoGeneric Component Energy Meter: power change is below threshold. Threshold 50 but delta is 43.402011718750146; skipping event

dev:422023-05-22 12:26:45.883infoGeneric Component Energy Meter: amperage change is below threshold. Threshold 1 but delta is 0.15900091552734352; skipping event

dev:422023-05-22 12:26:45.828infoGeneric Component Energy Meter: power change is below threshold. Threshold 50 but delta is 21.532871093750146; skipping event

dev:422023-05-22 12:26:42.887infoGeneric Component Energy Meter: amperage change is below threshold. Threshold 1 but delta is 0.2559991302490232; skipping event

dev:422023-05-22 12:26:42.829infoElectric 5813.84W

So the child clearly says what happens

Generic Component Energy Meter: change is below threshold. Threshold 1 but delta is 0.21900038146972634; skipping event

Using this (child) log you can adjust thresholds to more resonable values to get event more or less often

For example, you can try to set amperage threshold to 0.2 or 0.3 (this should be close equivalent of 450 and 680 W of power). Right now you have 1.0 that is around 2.2..2.3 kW. So it will 'see' only a teapot or water heater like load change.

For voltage on phase child devices something in range 2..10V threshold should do. 'Total' will not report voltage is there is no such thing as total voltage for 3 phases). It just uses the same child device type (with voltage attribute/event).

Regarding 4PM. It also needs thresholds. I'm going to add them too.
It uses different child device type(s). Specifically 'switch' and 'window shutter' (for cover profile). Right now there are no thresholds.

1 Like

Regarding energy report. This one is a bit harder. Documentation says device reports energy once it stores accumulated measurements in the internal memory. And this seem to happen once per hour (if I get documentation correctly). It needs patient log analisys for related reports to check if they were handled correctly.

Hi,
Just setting up my new Shelly 1 and have the same settings per your screenshot above.

Could you tell me please how you got the "Contact" parameter displayed under the Current States?
I can seem to get this listed, l have the same settings and the same device driver version

Thanks in advance

I have a problem with refreshing the status of Shelly 2.5 Swtich.
When I hit the button 'ON' or 'OFF' in device command section current state is not refreshed automatically. I need to hit 'Refresh' to update the current state.

I use 'Shelly WiFi Switch' driver and each channel is 'Generic Component Metering Switch'.

What can I do?

Maybe this could help

1 Like

Thank you so much.
That helped for my Shelly 2.5 and Shelly 1 switches.

1 Like

Hello @dmitry.rozovik. I am trying to use a shelly 2PM as cover. First steps are ok, hubitat creates the child devices and one of then is a Generic Component Metered Window Shade that controls the device for open and close flawlessly. However, when I try to set position, it doesn't work and this log appears:


Could you please check what is happening?
tks

Sure. I'll heck the code.

Update:
Looks like a typo in function argument list in the childdevice code. Will update the code shortly.

Update:
Fresh driver uploaded. You dont need to reinstall the device. Driver/bundle import is enough (only code update is needed).

Update:

Added Shelly Wall Display support. Special thanks to @simon for remote testing changes and helping to debug the driver. It were rather a set of fixes as all the required functionality were already inplace.

Supports temperature, humidity and luminance sensors as well as single switch and single input components.

Thinking on adding BLE gateway functionality (as Pro devices have ability to work as a BLE gateway):
For this to work a gateway will have to use local driver/translator script to send events trough the Hubitat Shelly driver. The event listening part is already in. But implemented as a simple string data packets. It is quite easy to add event type to pass child device attribute change. The only queston for now is about the best way to spawn child devices to handle BLE-parser-script generated events. Currently my head spins around some sort of handshake event sent at the shelly device boot (or rather translator-script start) that will ask/announce child devices it wants to send events to. And hubitat side driver will check and spawn those if they are missing. Basically a 'virtual component' device will be requested from withing shelly script to avoid constant driver changes each time when adding new BLE device type.

Not something to be seen soon as I have no BLE sensor device to test and develop on. It needs two side (hubitat api and shelly script) code changes to work on.

2 Likes

Shelly will be adding Room Thermometer support to the Wall Display in the coming weeks. Also an updated version of the wall display that will not require a negative power line..... Also webhooks that should allow us to trigger events on our hubs.

So I'm looking forward to these features, as I want to use Wall Displays in place of old Z-Wave battery operated room thermostats - getting them to send events to HE for my routines to fire on/off the heating.

Many thanks @dmitry.rozovik for the driver, works great and I look forward to assisting you in getting the new features operable when they arrive.

This driver already has ability to catch custom events from script within device it self.

To make it work a one (or more) script slot needs to be preallocated. Then after pressing 'configure' special switch-like child devices will be spawned for each script slot. The hold an event attribute to show last catched event. Devices them selves allow to start/stop scripts trough on/off commands (so the can be placed as tiles on dashbords).

Then shelly scipt can be written inside script slot. Here is an example of sending event (it can be found in the driver as a sample; but it is ill formatted on the device page so it is not so easy to read from there):

// Use this script to test driver-ShellyScript interation (and as a base)
// Script child devices appear after creating script and 'configuring' driver afterwards
// Note that 'Configure' will re-creare all child devices. So dashboards and rules have to be readjusted afterwards if were previously set!

let alertTimer = null;
let eventCount = 0;

function startTimer() {
  // 1S step is extremely aggressive for Hubitat. Set only for debugging/testing!
  let timeStep = 1 * 1000; // 1S
  alertTimer = Timer.set(timeStep, true, function (userData) {
    ++eventCount;
    // Would be nice to use restricted event name 'variable'. 
    // This will distinguish internal events and events adressed to the Hubitat hub

    // data can be of any JSON type. But will be passed as String
    Shelly.emitEvent("variable", eventCount); // This will be sent to the child script device attribute
  }, null/*userData*/ );
}

startTimer()

The main difference comparing to webhooks (aside of the ability to customize event contents and conditions) is that webhooks require opening inbound requests/connections to the hub while websocket stream events does not (as this stream is open/initiated from hub to device; it will just work).

1 Like

Could it be your driver is not working when the device is password protected?

It is possible. But it should. There were some mentions about changes in firmware changelog regarding passwords. Driver implements digest authtentification. On 0.14 it worked. I'll test on 1.0.3.

Logs should show what happens in advance.

Just checked on Pro 2PM:
After setting device passworg:

dev:4772023-09-20 21:37:34.121errorUnauthorized HTTP query. Please, check your password.

After setting same password on the driver side (upside down order):

dev:4772023-09-20 21:38:10.079info(Boiler (bathroom) script 3) Script running false
dev:4772023-09-20 21:38:10.033debug(Boiler (bathroom) script 3) parseShellyScriptStatus [id:3, running:false, mem_free:24108]
dev:4772023-09-20 21:38:10.029info(Boiler (bathroom) script 2) Script running true
dev:4772023-09-20 21:38:10.000debug(Boiler (bathroom) script 2) parseShellyScriptStatus [id:2, running:true, mem_used:1092, mem_peak:1610, mem_free:24108]
dev:4772023-09-20 21:38:09.996info(Boiler (bathroom) script 1) Script running false
dev:4772023-09-20 21:38:09.958debug(Boiler (bathroom) script 1) parseShellyScriptStatus [id:1, running:false, mem_free:24108]
dev:4772023-09-20 21:38:09.954debug(Boiler (bathroom) input 2) parseShellyCommonStatus [id:1, state:false]
dev:4772023-09-20 21:38:09.936info(Boiler (bathroom) input 2) Input state false
dev:4772023-09-20 21:38:09.908debug(Boiler (bathroom) input 2) parseShellyInputStatus [id:1, state:false]
dev:4772023-09-20 21:38:09.903debug(Boiler (bathroom) input 1) parseShellyCommonStatus [id:0, state:null]
dev:4772023-09-20 21:38:09.850debug(Boiler (bathroom) input 1) parseShellyInputStatus [id:0, state:null]
dev:4772023-09-20 21:38:09.847debugparseShellyEthernetStatus [ip:null]
dev:4772023-09-20 21:38:09.843debugparseShellyCloudStatus [connected:false]
dev:4772023-09-20 21:38:09.839debugHTTP Async Response: [id:112, auth:Digest] ::: [ble:[:], cloud:[connected:false], eth:[ip:null], input:0:[id:0, state:null], input:1:[id:1, state:false], mqtt:[connected:false], script:1:[id:1, running:false, mem_free:24108], script:2:[id:2, running:true, mem_used:1092, mem_peak:1610, mem_free:24108], script:3:[id:3, running:false, mem_free:24108], switch:0:[id:0, source:init, output:false, apower:0.0, voltage:1.6, freq:50.1, current:0.000, pf:0.00, aenergy:[total:0.000, by_minute:[0.000, 0.000, 0.000], minute_ts:1695235090], temperature:[tC:30.9, tF:87.6]], switch:1:[id:1, source:init, output:false, apower:0.0, voltage:1.8, freq:50.1, current:0.000, pf:0.00, aenergy:[total:0.000, by_minute:[0.000, 0.000, 0.000], minute_ts:1695235090], temperature:[tC:31.5, tF:88.8]], sys:[mac:EC62608DC75C, restart_required:false, time:21:38, unixtime:1695235091, uptime:22017, ram_size:243156, ram_free:138424, fs_size:524288, fs_free:188416, cfg_rev:60, kvs_rev:4, schedule_rev:2, webhook_rev:0, available_updates:[:]], wifi:[sta_ip:192.168.1.197, status:got ip, ssid:Linksys07064, rssi:-68], ws:[connected:false]]
dev:4772023-09-20 21:38:09.693infoHTTP authtentification sequence...
dev:4772023-09-20 21:38:09.273debugHTTP Async query: Shelly.GetStatus([:])
1 Like

question, when password is ON, does you child switch works?

Some logs when I add the device password protected

dev:26622023-09-20 21:59:45.290debugHTTP Async Response: [id:112, auth:Digest] ::: [ble:[:], cloud:[connected:true], input:0:[id:0, state:false], input:1:[id:1, state:false], mqtt:[connected:false], switch:0:[id:0, source:switch, output:false, apower:0.0, voltage:234.0, freq:50.1, current:0.000, pf:0.00, aenergy:[total:3.110, by_minute:[0.000, 0.000, 0.000], minute_ts:1695239982], temperature:[tC:53.3, tF:127.9]], switch:1:[id:1, source:init, output:true, apower:8.7, voltage:234.1, freq:50.1, current:0.065, pf:0.57, aenergy:[total:11.624, by_minute:[110.919, 157.744, 155.167], minute_ts:1695239982], temperature:[tC:53.3, tF:127.9]], sys:[mac:B8D61A88F910, restart_required:false, time:21:59, unixtime:1695239984, uptime:1077, ram_size:243132, ram_free:128320, fs_size:458752, fs_free:143360, cfg_rev:46, kvs_rev:0, schedule_rev:0, webhook_rev:0, available_updates:[:]], wifi:[sta_ip:192.168.178.140, status:got ip, ssid:Antartica, rssi:-65], ws:[connected:false]]

dev:26622023-09-20 21:59:45.246debugHTTP Async Response: [id:112, auth:Digest] ::: [ble:[:], cloud:[connected:true], input:0:[id:0, state:false], input:1:[id:1, state:false], mqtt:[connected:false], switch:0:[id:0, source:switch, output:false, apower:0.0, voltage:234.0, freq:50.1, current:0.000, pf:0.00, aenergy:[total:3.110, by_minute:[0.000, 0.000, 0.000], minute_ts:1695239982], temperature:[tC:53.3, tF:127.9]], switch:1:[id:1, source:init, output:true, apower:8.7, voltage:234.1, freq:50.1, current:0.065, pf:0.57, aenergy:[total:11.624, by_minute:[110.919, 157.744, 155.167], minute_ts:1695239982], temperature:[tC:53.3, tF:127.9]], sys:[mac:B8D61A88F910, restart_required:false, time:21:59, unixtime:1695239984, uptime:1077, ram_size:243080, ram_free:126912, fs_size:458752, fs_free:143360, cfg_rev:46, kvs_rev:0, schedule_rev:0, webhook_rev:0, available_updates:[:]], wifi:[sta_ip:192.168.178.140, status:got ip, ssid:Antartica, rssi:-65], ws:[connected:false]]

dev:26622023-09-20 21:59:45.198infoHTTP authtentification sequence...

dev:26622023-09-20 21:59:45.163infoHTTP authtentification sequence...

dev:26622023-09-20 21:59:45.138debugHTTP Async query: Shelly.GetStatus([:])

dev:26622023-09-20 21:59:45.104debugHTTP Async query: Shelly.GetStatus([:])

dev:26622023-09-20 21:59:45.100errorconfigure: status code: 401, reason phrase: Unauthorized. Can't configure child devices. Please, re-try.

dev:26622023-09-20 21:59:45.048debugHTTP authtentification sequence...

dev:26622023-09-20 21:59:45.046debughttpGet incident: groovyx.net.http.HttpResponseException: status code: 401, reason phrase: Unauthorized

dev:26622023-09-20 21:59:45.009debugHTTP Sync query: Shelly.GetStatus([:])

dev:26622023-09-20 21:59:45.006infoVersion Report Generic - FirmwareVersion: 1.0.3, ProtocolVersion: 2, HardwareVersion: SNSW-102P16EU

dev:26622023-09-20 21:59:45.004infoDevice info response [name:null, id:shellyplus2pm-b8d61a88f910, mac:B8D61A88F910, slot:1, model:SNSW-102P16EU, gen:2, fw_id:20230912-081945/1.0.3-g6176478, ver:1.0.3, app:Plus2PM, auth_en:true, auth_domain:shellyplus2pm-b8d61a88f910, profile:switch]

dev:26622023-09-20 21:59:45.001debugHTTP Sync Response: [name:null, id:shellyplus2pm-b8d61a88f910, mac:B8D61A88F910, slot:1, model:SNSW-102P16EU, gen:2, fw_id:20230912-081945/1.0.3-g6176478, ver:1.0.3, app:Plus2PM, auth_en:true, auth_domain:shellyplus2pm-b8d61a88f910, profile:switch]

dev:26622023-09-20 21:59:44.960debugHTTP Sync query: Shelly.GetDeviceInfo([:])

dev:26622023-09-20 21:59:44.958infoInitial value

dev:26622023-09-20 21:59:44.955infoReconnecting in 30 seconds.

dev:26622023-09-20 21:59:44.953infoInitial value

dev:26622023-09-20 21:59:44.950infoConnection failed: Connection reset

dev:26622023-09-20 21:59:44.948infoInitial value

dev:26622023-09-20 21:59:44.945infoInitial value

dev:26622023-09-20 21:59:44.941infoInitial value

dev:26622023-09-20 21:59:44.938infoInitial value

dev:26622023-09-20 21:59:44.935infoInitial value

dev:26622023-09-20 21:59:44.933infoInitial value

It seems there is some issue with websocket connection in password protected mode (HTTP queries are working just fine) From what I see device resets connection each time when receiving command. I'll nvestigate tomorrow in depth.

Update:
A driver with authentification fix is submitted.

The problem in fact were only related to HTTP requests that had 'query' property set. Authentification encoding were ignorring url query part.
Also this property does not handle empty container correctly on the Hubitat side (it should be either non-empty or null; it generates weird behavior if set to [:]).

Side note: if password was changed without rebooting shelly device, the driver will need to be reconnected (disconnect/connect). The driver has no feedback on if password were changed or not. Otherwise old stream will remain open. Device allows opening unauthentificated stream. But in this case device will not respond to websocket commands while continuing to send events back to the hub.
This one can be improoved. Device sends event about configuration change (without specific details). It can be used for autoreconnection (and failure till proper password is set)

A side of it a guard check is added in case if shelly add-on module is attached. As add-on components have ids starting 100 the driver could spawn quite a bunch of ghost child devices. For the moment add-on units are not supported (will be simply ignored).

1 Like

Yep, issue solved:-)

Sometimes I see an error, any idea?
Password is OK, everything is working fine

Logs

dev:26622023-09-22 19:59:44.206debugparseShellyWifiStatus [sta_ip:192.168.178.140, status:got ip, ssid:Antartica, rssi:-58]

dev:26622023-09-22 19:59:44.203infoConfiguration revision 48

dev:26622023-09-22 19:59:44.179info(192.168.178.140 temperature sensor 2) Sensor generic report: Air temperature:temperature 43.5°C

dev:26622023-09-22 19:59:44.176debug(192.168.178.140 temperature sensor 2) parseShellyTemperatureSensorStatus [tC:43.5, tF:110.3]

dev:26622023-09-22 19:59:44.148info(192.168.178.140 switch 2) Meter generic report: Electric:voltage 236.6V

dev:26622023-09-22 19:59:44.145info(192.168.178.140 switch 2) Power factor 0.00

dev:26622023-09-22 19:59:44.117info(192.168.178.140 switch 2) Sensor generic report: Frequency:frequency 50.0Hz

dev:26622023-09-22 19:59:44.084info(192.168.178.140 switch 2) Meter generic report: Electric:amperage 0.0A

dev:26622023-09-22 19:59:44.055info(192.168.178.140 switch 2) Meter generic report: Electric:power 0.0W

dev:26622023-09-22 19:59:44.027info(192.168.178.140 switch 2) Meter generic report: Electric:energy 0.003451kWh

dev:26622023-09-22 19:59:44.024debug(192.168.178.140 switch 2) parseShellyCommonStatus [id:1, source:HTTP_in, output:false, apower:0.0, voltage:236.6, freq:50.0, current:0.000, pf:0.00, aenergy:[total:3.451, by_minute:[0.000, 0.000, 0.000], minute_ts:1695405579], temperature:[tC:43.5, tF:110.3]]

dev:26622023-09-22 19:59:44.001debug(192.168.178.140 switch 2) parseShellySwitchStatus [id:1, source:HTTP_in, output:false, apower:0.0, voltage:236.6, freq:50.0, current:0.000, pf:0.00, aenergy:[total:3.451, by_minute:[0.000, 0.000, 0.000], minute_ts:1695405579], temperature:[tC:43.5, tF:110.3]]

dev:26622023-09-22 19:59:43.970info(192.168.178.140 temperature sensor 1) Sensor generic report: Air temperature:temperature 43.5°C

dev:26622023-09-22 19:59:43.960debug(192.168.178.140 temperature sensor 1) parseShellyTemperatureSensorStatus [tC:43.5, tF:110.3]

dev:26622023-09-22 19:59:43.916info(192.168.178.140 switch 1) Meter generic report: Electric:voltage 236.5V

dev:26622023-09-22 19:59:43.913info(192.168.178.140 switch 1) Power factor 0.00

dev:26622023-09-22 19:59:43.872info(192.168.178.140 switch 1) Sensor generic report: Frequency:frequency 50.0Hz

dev:26622023-09-22 19:59:43.843info(192.168.178.140 switch 1) Meter generic report: Electric:amperage 0.0A

dev:26622023-09-22 19:59:43.810info(192.168.178.140 switch 1) Meter generic report: Electric:power 0.0W

dev:26622023-09-22 19:59:43.779info(192.168.178.140 switch 1) Meter generic report: Electric:energy 0.005091kWh

dev:26622023-09-22 19:59:43.775debug(192.168.178.140 switch 1) parseShellyCommonStatus [id:0, source:button, output:false, apower:0.0, voltage:236.5, freq:50.0, current:0.000, pf:0.00, aenergy:[total:5.091, by_minute:[0.000, 0.000, 0.000], minute_ts:1695405579], temperature:[tC:43.5, tF:110.3]]

dev:26622023-09-22 19:59:43.747debug(192.168.178.140 switch 1) parseShellySwitchStatus [id:0, source:button, output:false, apower:0.0, voltage:236.5, freq:50.0, current:0.000, pf:0.00, aenergy:[total:5.091, by_minute:[0.000, 0.000, 0.000], minute_ts:1695405579], temperature:[tC:43.5, tF:110.3]]

dev:26622023-09-22 19:59:43.740debug(192.168.178.140 input 2) parseShellyCommonStatus [id:1, state:false]

dev:26622023-09-22 19:59:43.737info(192.168.178.140 input 2) Input state false

dev:26622023-09-22 19:59:43.714debug(192.168.178.140 input 2) parseShellyInputStatus [id:1, state:false]

dev:26622023-09-22 19:59:43.711debug(192.168.178.140 input 1) parseShellyCommonStatus [id:0, state:null]

dev:26622023-09-22 19:59:43.691debug(192.168.178.140 input 1) parseShellyInputStatus [id:0, state:null]

dev:26622023-09-22 19:59:43.688debugparseShellyCloudStatus [connected:true]

dev:26622023-09-22 19:59:43.682debugHTTP Async Response: [id:112, request:[uri:http://192.168.178.140, path:/rpc/Shelly.GetStatus, requestContentType:application/json, headers:[Authorization:Digest username="admin", realm="shellyplus2pm-b8d61a88f910", qop=auth, algorithm=SHA-256, uri="/rpc/Shelly.GetStatus", nonce="1695405580", nc=1, cnonce="1695405580", opaque="", response="6fa1483f8c85992e43089edc9ff4b0654552d9a6db37f237f2bdbfa31c0d6a0b"]], auth:Digest] ::: [ble:[:], cloud:[connected:true], input:0:[id:0, state:null], input:1:[id:1, state:false], mqtt:[connected:false], switch:0:[id:0, source:button, output:false, apower:0.0, voltage:236.5, freq:50.0, current:0.000, pf:0.00, aenergy:[total:5.091, by_minute:[0.000, 0.000, 0.000], minute_ts:1695405579], temperature:[tC:43.5, tF:110.3]], switch:1:[id:1, source:HTTP_in, output:false, apower:0.0, voltage:236.6, freq:50.0, current:0.000, pf:0.00, aenergy:[total:3.451, by_minute:[0.000, 0.000, 0.000], minute_ts:1695405579], temperature:[tC:43.5, tF:110.3]], sys:[mac:B8D61A88F910, restart_required:false, time:19:59, unixtime:1695405581, uptime:79170, ram_size:243228, ram_free:132020, fs_size:458752, fs_free:143360, cfg_rev:48, kvs_rev:0, schedule_rev:0, webhook_rev:0, available_updates:[:]], wifi:[sta_ip:192.168.178.140, status:got ip, ssid:Antartica, rssi:-58], ws:[connected:false]]

dev:26622023-09-22 19:59:43.577infoHTTP authtentification sequence...

dev:26622023-09-22 19:59:43.478errorUnauthorized WS query. Please, check your password.

dev:26622023-09-22 19:59:43.458debugHTTP Async query: Shelly.GetStatus([:])

dev:26622023-09-22 19:59:43.436debugWS query: {"params":{id:0}, "id":80, "method":"Input.GetStatus", "src":"hub", "auth":{"username": "admin", "realm": "shellyplus2pm-b8d61a88f910", "algorithm": "SHA-256", "nonce": "1695401960", "cnonce": "1695401960", "response": "44bf1c8627e8f4ee7bd354037f7925706472ea5da10e5e71c07f5056698fdcac"}}

dev:26622023-09-22 19:59:43.432infoReceived 'refresh' request from 192.168.178.140 input 1 (EP1)

dev:26622023-09-22 19:59:43.360infoReconnecting in 30 seconds.

dev:26622023-09-22 19:59:43.355infoConnection failed: Connection reset

dev:26622023-09-22 19:59:13.902debugparseShellyWifiStatus [sta_ip:192.168.178.140, status:got ip, ssid:Antartica, rssi:-58]

dev:26622023-09-22 19:59:13.899infoConfiguration revision 48

dev:26622023-09-22 19:59:13.874info(192.168.178.140 temperature sensor 2) Sensor generic report: Air temperature:temperature 43.6°C

dev:26622023-09-22 19:59:13.871debug(192.168.178.140 temperature sensor 2) parseShellyTemperatureSensorStatus [tC:43.6, tF:110.4]

dev:26622023-09-22 19:59:13.842info(192.168.178.140 switch 2) Meter generic report: Electric:voltage 235.9V

dev:26622023-09-22 19:59:13.839info(192.168.178.140 switch 2) Power factor 0.00

dev:26622023-09-22 19:59:13.811info(192.168.178.140 switch 2) Sensor generic report: Frequency:frequency 50.0Hz

dev:26622023-09-22 19:59:13.783info(192.168.178.140 switch 2) Meter generic report: Electric:amperage 0.0A

dev:26622023-09-22 19:59:13.754info(192.168.178.140 switch 2) Meter generic report: Electric:power 0.0W

dev:26622023-09-22 19:59:13.728info(192.168.178.140 switch 2) Meter generic report: Electric:energy 0.003451kWh

dev:26622023-09-22 19:59:13.725debug(192.168.178.140 switch 2) parseShellyCommonStatus [id:1, source:HTTP_in, output:false, apower:0.0, voltage:235.9, freq:50.0, current:0.000, pf:0.00, aenergy:[total:3.451, by_minute:[0.000, 0.000, 0.000], minute_ts:1695405549], temperature:[tC:43.6, tF:110.4]]

dev:26622023-09-22 19:59:13.698debug(192.168.178.140 switch 2) parseShellySwitchStatus [id:1, source:HTTP_in, output:false, apower:0.0, voltage:235.9, freq:50.0, current:0.000, pf:0.00, aenergy:[total:3.451, by_minute:[0.000, 0.000, 0.000], minute_ts:1695405549], temperature:[tC:43.6, tF:110.4]]

dev:26622023-09-22 19:59:13.669info(192.168.178.140 temperature sensor 1) Sensor generic report: Air temperature:temperature 43.6°C

dev:26622023-09-22 19:59:13.666debug(192.168.178.140 temperature sensor 1) parseShellyTemperatureSensorStatus [tC:43.6, tF:110.4]

dev:26622023-09-22 19:59:13.637info(192.168.178.140 switch 1) Meter generic report: Electric:voltage 235.9V

dev:26622023-09-22 19:59:13.634info(192.168.178.140 switch 1) Power factor 0.00

dev:26622023-09-22 19:59:13.604info(192.168.178.140 switch 1) Sensor generic report: Frequency:frequency 50.0Hz

dev:26622023-09-22 19:59:13.574info(192.168.178.140 switch 1) Meter generic report: Electric:amperage 0.0A

dev:26622023-09-22 19:59:13.544info(192.168.178.140 switch 1) Meter generic report: Electric:power 0.0W

dev:26622023-09-22 19:59:13.515info(192.168.178.140 switch 1) Meter generic report: Electric:energy 0.005091kWh

dev:26622023-09-22 19:59:13.512debug(192.168.178.140 switch 1) parseShellyCommonStatus [id:0, source:button, output:false, apower:0.0, voltage:235.9, freq:50.0, current:0.000, pf:0.00, aenergy:[total:5.091, by_minute:[0.000, 0.000, 0.000], minute_ts:1695405549], temperature:[tC:43.6, tF:110.4]]

dev:26622023-09-22 19:59:13.483debug(192.168.178.140 switch 1) parseShellySwitchStatus [id:0, source:button, output:false, apower:0.0, voltage:235.9, freq:50.0, current:0.000, pf:0.00, aenergy:[total:5.091, by_minute:[0.000, 0.000, 0.000], minute_ts:1695405549], temperature:[tC:43.6, tF:110.4]]

dev:26622023-09-22 19:59:13.479debug(192.168.178.140 input 2) parseShellyCommonStatus [id:1, state:false]

dev:26622023-09-22 19:59:13.476info(192.168.178.140 input 2) Input state false

dev:26622023-09-22 19:59:13.452debug(192.168.178.140 input 2) parseShellyInputStatus [id:1, state:false]

dev:26622023-09-22 19:59:13.449debug(192.168.178.140 input 1) parseShellyCommonStatus [id:0, state:null]

dev:26622023-09-22 19:59:13.427debug(192.168.178.140 input 1) parseShellyInputStatus [id:0, state:null]

dev:26622023-09-22 19:59:13.424debugparseShellyCloudStatus [connected:true]

dev:26622023-09-22 19:59:13.421debugHTTP Async Response: [id:112, request:[uri:http://192.168.178.140, path:/rpc/Shelly.GetStatus, requestContentType:application/json, headers:[Authorization:Digest username="admin", realm="shellyplus2pm-b8d61a88f910", qop=auth, algorithm=SHA-256, uri="/rpc/Shelly.GetStatus", nonce="1695405550", nc=1, cnonce="1695405550", opaque="", response="01ae6017f8d0b6b8d2408591ad2bfe539b95c9fa250459f4bb260c86545340bb"]], auth:Digest] ::: [ble:[:], cloud:[connected:true], input:0:[id:0, state:null], input:1:[id:1, state:false], mqtt:[connected:false], switch:0:[id:0, source:button, output:false, apower:0.0, voltage:235.9, freq:50.0, current:0.000, pf:0.00, aenergy:[total:5.091, by_minute:[0.000, 0.000, 0.000], minute_ts:1695405549], temperature:[tC:43.6, tF:110.4]], switch:1:[id:1, source:HTTP_in, output:false, apower:0.0, voltage:235.9, freq:50.0, current:0.000, pf:0.00, aenergy:[total:3.451, by_minute:[0.000, 0.000, 0.000], minute_ts:1695405549], temperature:[tC:43.6, tF:110.4]], sys:[mac:B8D61A88F910, restart_required:false, time:19:59, unixtime:1695405550, uptime:79140, ram_size:243124, ram_free:130856, fs_size:458752, fs_free:143360, cfg_rev:48, kvs_rev:0, schedule_rev:0, webhook_rev:0, available_updates:[:]], wifi:[sta_ip:192.168.178.140, status:got ip, ssid:Antartica, rssi:-58], ws:[connected:false]]

dev:26622023-09-22 19:59:13.341debug(192.168.178.140 input 1) parseShellyCommonStatus [id:0, state:null]

dev:26622023-09-22 19:59:13.332infoHTTP authtentification sequence...

dev:26622023-09-22 19:59:13.316debug(192.168.178.140 input 1) parseShellyInputStatus [id:0, state:null]

dev:26622023-09-22 19:59:13.248debugHTTP Async query: Shelly.GetStatus([:])

dev:26622023-09-22 19:59:13.244debugWS query: {"params":{id:0}, "id":80, "method":"Input.GetStatus", "src":"hub", "auth":{"username": "admin", "realm": "shellyplus2pm-b8d61a88f910", "algorithm": "SHA-256", "nonce": "1695401960", "cnonce": "1695401960", "response": "44bf1c8627e8f4ee7bd354037f7925706472ea5da10e5e71c07f5056698fdcac"}}

dev:26622023-09-22 19:59:13.233infoReceived 'refresh' request from 192.168.178.140 input 1 (EP1)

dev:26622023-09-22 19:59:13.192infoReconnecting in 30 seconds.

dev:26622023-09-22 19:59:13.186infoConnection failed: Connection reset

This specific error usually happens when dvice password were changed without rebooting device. Stream remains connected (with old password). So reconnection should remove it. Reconnection will eventually happen implicitely when device or hub reboots.

If you constantly see deriver reconnection sequence each 30S ( dev:26622023-09-22 19:59:43.360infoReconnecting in 30 seconds.), this means something goes wrong. Normally connection should remain open.

From what I can see there are some changes either in the shelly device behavior or in the hub logic. When I manually disconnect, WS returns failure while originally it should return 'closing' state. But when device reboots it closes stream gracefully (and so connection is not auto restored). I cannot affetc returned status. But I'll improove reconnection behavior.

1 Like