kw123 / SHELLY

plugin for indigo home automation w native support for SHELLY wifi devices
MIT License
0 stars 0 forks source link

ActionValue key errors #1

Open AaronLionsheep opened 4 years ago

AaronLionsheep commented 4 years ago

Hey Karl,

I was looking through your code and noticed you had a few typos in the key values for the following:

https://github.com/kw123/SHELLY/blob/5263e7691655020edc0681ef4156db622eb12492/shelly.indigoPlugin/Contents/Server%20Plugin/plugin.py#L2482

https://github.com/kw123/SHELLY/blob/5263e7691655020edc0681ef4156db622eb12492/shelly.indigoPlugin/Contents/Server%20Plugin/plugin.py#L2543

And you check for the red color being presented twice instead of checking if green is present:

https://github.com/kw123/SHELLY/blob/5263e7691655020edc0681ef4156db622eb12492/shelly.indigoPlugin/Contents/Server%20Plugin/plugin.py#L2535

kw123 commented 4 years ago

Aron,

thanks so much for checking,

fixed.

I have a version ready that does everything automatically. just enter ip number in plugin discovery menu and will set the required parameters to the shelly devices:

  1. actions —> will mkethe shelly dev perform an http get to the indigo server with the changed / updated data (temp hum /on/off button press)
  2. params for buttons (toggle/edge..) and power on (on/off/last..)

one thing I observed was that when you do a long press of the input button your get several messages: on long off

That makes it a little tricky on what to show in the dev/state.

You could do a trigger on the state, but when you look it is already changed.

So I was thinking to setup an option to define the button in the same way as on the device (toggle …) But that requires a VERY tight sync with the device, any missed message would put the state out of sync ...still thinking.

I am still at awe about these little devices. I did an amateur version with an esp chip and the 3 year old arduino plugin This is (light) years ahead in hard and software, no comparison, not even close.

The only think that is missing is the option to attach other sensors besides onewire and DHT22, a BME680 or some of the gas or analog sensors would be great. The esp chip on board has all the pins, but they only expose a few.

Karl

ps you mentioned that you are at a college .. student or staff? I am 62, happily retired, did a phd in physics a lifetime ago and went into the chemical industry, was A CIO at Celanese for 10 years. No IT stuff there, only emails and PowerPoints hiring and firing people, budget fights etc back to the roots now

And I read on the SHELLY forum that they want to go with the new COxx?? (forgot the name) communication protocol ONLY in the future. That would be sad. And they have delivery problems of parts form China

AaronLionsheep commented 4 years ago

My goal is to have my plugin also be able to create devices automatically. Once a Shelly is on the network and connected to a broker, you can send a command to ALL Shelly devices on a broker on shellies/command and tell them to announce. They all respond with their address and some other meta-data.

I decided to expose the input switch as two separate states for my devices:

The separated states decouples the plugin from how the device is configured. Plus it also gives some more flexibility to Indigo since somebody might not care if it is simply on or long-pressed.

As for the add-on sensors, I think they plan to release some more sensors. This is according to CliveS from his post (https://forums.indigodomo.com/viewtopic.php?p=189393#p189393) about the release of new devices.

I REALLY hope they don't remove HTTP and MQTT functionality in the future. I think MQTT is pretty neat. Plus that would mean our plugins would need some major overhauling...

I think the protocol is CoAP (https://en.wikipedia.org/wiki/Constrained_Application_Protocol), which to me looks like Z-Wave over WiFi/UDP. As long as they keep sticking the ESP chip in there, I don't see a reason why they have to remove HTTP and/or MQTT.


I am a student at college (Computer Science). I managed to work my plugin development into a "Technology Community Service" requirement for one of my classes. Now I can work on my plugin instead of "school work" and not feel bad haha! I wonder if Indigo is hiring - I've been exposed to it for over half of my life...

Aaron

kw123 commented 4 years ago

Aron,

which year are you in, already looking for a job? I have 3 sons, youngest is 26. The middle is just finishing his MBA at Chicago-Booth and he has signed job offer. BUT he told that several of his colleagues don’t have a job offer and right now hiring and interviewing has come to a halt.

I remember the executive meeting 2008 when we had a week without any order. That was tough, immediate 20% staff cut, all travel canceled, all projects that can be stopped cancelled.. feels a little like that.

I come from Germany. Lufthansa is in that phase right now. My youngest is Accenture consultant, he told me that all Accenture folks had to stop working at Lufthansa ..

Looking at Italy they have to make decision now who of the really sick folks get the equipment and who is left to die. .. intensive care devices are all used

We - my wife and I wanted to fly to germany in 2 weeks, I guess that will not happen

Anyway also this will end and life will go on ..and indigo will survive and new opportunities for plugins will emerge

Karl

On Mar 11, 2020, at 09:11, Aaron notifications@github.com wrote:

My goal is to have my plugin also be able to create devices automatically. Once a Shelly is on the network and connected to a broker, you can send a command to ALL Shelly devices on a broker on shellies/command and tell them to announce. They all respond with their address and some other meta-data.

I decided to expose the input switch as two separate states for my devices:

sw-input will be either true or false to indicate if the on-board button is currently pressed or not longpress will be either true or false to indicate if the onboard button is being long-pressed. The separated states decouples the plugin from how the device is configured. Plus it also gives some more flexibility to Indigo since somebody might not care if it is simply on or long-pressed.

As for the add-on sensors, I think they plan to release some more sensors. This is according to CliveS from his post (https://forums.indigodomo.com/viewtopic.php?p=189393#p189393 https://forums.indigodomo.com/viewtopic.php?p=189393#p189393) about the release of new devices.

I REALLY hope they don't remove HTTP and MQTT functionality in the future. I think MQTT is pretty neat. Plus that would mean our plugins would need some major overhauling...

I think the protocol is CoAP (https://en.wikipedia.org/wiki/Constrained_Application_Protocol https://en.wikipedia.org/wiki/Constrained_Application_Protocol), which to me looks like Z-Wave over WiFi/UDP. As long as they keep sticking the ESP chip in there, I don't see a reason why they have to remove HTTP and/or MQTT.

I am a student at college (Computer Science). I managed to work my plugin development into a "Technology Community Service" requirement for one of my classes. Now I can work on my plugin instead of "school work" and not feel bad haha! I wonder if Indigo is hiring - I've been exposed to it for over half of my life...

Aaron

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kw123/SHELLY/issues/1#issuecomment-597657387, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEH2SNBWNF2I5CVDAZTAVGDRG6L2RANCNFSM4LFUTKNA.

kw123 commented 4 years ago

Aron,

like the discussion..

as for long press: Would it not be better to put a time stamp instead of True False into the state.

I imagine long press would be 2 secs or so and then its over, continuously pressed would show in the regular state input on/off

You could still trigger on and state change, but you would still have the info when it happened

Karl

On Mar 11, 2020, at 09:11, Aaron notifications@github.com wrote:

My goal is to have my plugin also be able to create devices automatically. Once a Shelly is on the network and connected to a broker, you can send a command to ALL Shelly devices on a broker on shellies/command and tell them to announce. They all respond with their address and some other meta-data.

I decided to expose the input switch as two separate states for my devices:

sw-input will be either true or false to indicate if the on-board button is currently pressed or not longpress will be either true or false to indicate if the onboard button is being long-pressed. The separated states decouples the plugin from how the device is configured. Plus it also gives some more flexibility to Indigo since somebody might not care if it is simply on or long-pressed.

As for the add-on sensors, I think they plan to release some more sensors. This is according to CliveS from his post (https://forums.indigodomo.com/viewtopic.php?p=189393#p189393 https://forums.indigodomo.com/viewtopic.php?p=189393#p189393) about the release of new devices.

I REALLY hope they don't remove HTTP and MQTT functionality in the future. I think MQTT is pretty neat. Plus that would mean our plugins would need some major overhauling...

I think the protocol is CoAP (https://en.wikipedia.org/wiki/Constrained_Application_Protocol https://en.wikipedia.org/wiki/Constrained_Application_Protocol), which to me looks like Z-Wave over WiFi/UDP. As long as they keep sticking the ESP chip in there, I don't see a reason why they have to remove HTTP and/or MQTT.

I am a student at college (Computer Science). I managed to work my plugin development into a "Technology Community Service" requirement for one of my classes. Now I can work on my plugin instead of "school work" and not feel bad haha! I wonder if Indigo is hiring - I've been exposed to it for over half of my life...

Aaron

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kw123/SHELLY/issues/1#issuecomment-597657387, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEH2SNBWNF2I5CVDAZTAVGDRG6L2RANCNFSM4LFUTKNA.

AaronLionsheep commented 4 years ago

There is a single topic that reports both on, off, and long press. So as soon as user releases the button after triggering a long press, both the sw-input and longpress become false.

kw123 commented 4 years ago

here my version for the DM-1 dimmer

I have created 2 devices for the SHELLY-25 2 relays to be able to show device ON / off i the onOffState that has made things a little complex ..

Also how do you handle the input state: input / input_0 _1_2 ?

the Shelly dev counts from 1 when they show things, but the list gives 0 /1

a little confusing, My current thinking:

if only one input: state name = input if 2 state names = input_1 input_2

any thoughts?

For the relays with the split of the -25 there is only on relay per device, that make that straight forward

Karl

On Mar 11, 2020, at 11:13, Aaron notifications@github.com wrote:

There is a single topic that reports both on, off, and long press. So as soon as user releases the button after triggering a long press, both the sw-input and longpress become false.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kw123/SHELLY/issues/1#issuecomment-597725437, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEH2SNAWOYLHE7ISZQA6G6LRG62CHANCNFSM4LFUTKNA.

AaronLionsheep commented 4 years ago

I did the same with the Shelly 2.5. I determined that that device is pretty much two Shelly 1PM's in a single enclosure. So my Shelly 2.5 Indigo device represent half of a Shelly 2.5 and is modeled after the Shelly 1PM. My 2.5 device lets the user specify the "channel" as channel 0 or 1 to identify which relay they will control. I decided to just group a single input switch with a single relay.

Channel x

Each device subscribes to these topics with a 0 or 1 as the x shellies/shellyswitch25-<deviceid>/input/x for each SW input x shellies/shellyswitch25-<deviceid>/longpush/x for each SW input x; reports a value indicating longpush state as 0 or 1 shellies/shellyswitch25-<deviceid>/relay/x for each relay x shellies/shellyswitch25-<deviceid>/relay/x/command for each relay x shellies/shellyswitch25-<deviceid>/relay/x/power for each relay x shellies/shellyswitch25-<deviceid>/relay/x/energy for each relay x

Both devices

Both of the indigo devices for a single 2.5 relay will subscribe to these topics since the internal temperature is shared between the two. shellies/shellyswitch25-<deviceid>/temperature reports internal device temperature in °C shellies/shellyswitch25-<deviceid>/overtemperature reports 1 when device has overheated, normally 0

Numbering

As for the numbering, they use zero-indexing internally, but just use 1-indexing since that is more user-friendly. I simply just did the following in my "channel selection" part of the device config:

<Field type="menu" id="channel" defaultValue="0">
    <Label>Relay Channel:</Label>
    <List>
        <Option value="0">Channel 1</Option>
        <Option value="1">Channel 2</Option>
     </List>
</Field>

So the user is presented with 1-based indexing and internally I automatically get 0-based indexing.

I actually decided that internally, all devices have "channels", even though the majority of devices are a single channel. These single channel devices have the Chanel selection hidden and just default to 0. My architecture then allows me to build devices off of one another without rewriting too much code (and introducing "undesired features").

For example, my Shelly 2.5 device allows the user to select a channel and only has 30 lines of code since it inherits almost all features from the Shelly 1PM (which inherits the majority of its code from the Shelly 1... and it keeps going). https://github.com/AaronLionsheep/ShellyMQTT/blob/0.6.0/ShellyMQTT.indigoPlugin/Contents/Server%20Plugin/Devices/Relays/Shelly_2_5_Relay.py

If you're interested, take a look at how I was able to structure my device implementations. It seems that most of the Shelly devices are actually built on top of each other, so I tried to model my code this way too.

kw123 commented 4 years ago

Aron,

I see you are studying Computer science, well organized.

I learned programming with assembler reading hardware sensors (high energy physics particle tracking) on a pdp11 w 32KByte ram - that dates me Then the analysis was done in fortran IV on an ibm 370 MVS in batch jobs A typical event was 250kB in size using all bits with /common/ and overlays so that it fits into the mainframe Our data acquisition rate was 3 events / second Now at CERN everything is factor of 10**7 or more higher

And my code still looks like fortran, but I have fund doing it.

Karl

just for your records, here a pseudo json with the /settings / status out put of all device types I have BBEDIT can collapse /expand it , some" }," are missing to make it json.loads reading correctly, but then BBedit complains

{ "SHSW-25":{ "settings":{"device":{"type":"SHSW-25","mac":"2CF43268CFBB","hostname":"shellyswitch25-68CFBB","num_outputs":2, "num_meters":2, "num_rollers":1},"wifi_ap":{"enabled":false,"ssid":"shellyswitch25-68CFBB","key":""},"wifi_sta":{"enabled":true,"ssid":"xxx","ipv4_method":"static","ip":"192.168.1.108","gw":"192.168.1.1","mask":"255.255.255.0","dns":"192.168.1.1"},"wifi_sta1":{"enabled":false,"ssid":null,"ipv4_method":"dhcp","ip":null,"gw":null,"mask":null,"dns":null},"mqtt": {"enable":false,"server":"192.168.33.3:1883","user":"","id":"shellyswitch25-68CFBB","reconnect_timeout_max":60.000000,"reconnect_timeout_min":2.000000,"clean_session":true,"keep_alive":60,"max_qos":0,"retain":false,"update_period":30},"sntp":{"server":"time.google.com","enabled":true},"login":{"enabled":false,"unprotected":false,"username":"admin","password":"admin"},"pin_code":"","name":"","fw":"20200206-083126/v1.5.10@e6a4205e","build_info":{"build_id":"20200206-083126/v1.5.10@e6a4205e","build_timestamp":"2020-02-06T08:31:26Z","build_version":"1.0"},"cloud":{"enabled":false,"connected":false},"timezone":"America/Chicago","lat":32.948299,"lng":-96.729897,"tzautodetect":true,"tz_utc_offset":-18000,"tz_dst":true,"tz_dst_auto":true,"time":"14:42","hwinfo":{"hw_revision":"prod-2019-03", "batch_id":1},"mode":"relay","max_power":1840,"relays":[{"name":null,"ison":true,"has_timer":false,"overpower":false,"default_state":"off","btn_type":"edge","btn_reverse":1,"auto_on":0.00,"auto_off":0.00,"max_power":0,"btn_on_url":"http://192.168.1.50:7987/?input=on","btn_off_url":"http://192.168.1.50:7987/?input=off","out_on_url":"http://192.168.1.50:7987/?onOffState=1","out_off_url":"http://192.168.1.50:7987/?onOffState=0","longpush_url":"http://192.168.1.50:7987/?input=long","shortpush_url":"http://192.168.1.50:7987/?input=short","schedule":false,"schedule_rules":[]},{"name":null,"ison":true,"has_timer":false,"overpower":false,"default_state":"off","btn_type":"toggle","btn_reverse":0,"auto_on":0.00,"auto_off":0.00,"max_power":0,"btn_on_url":"http://192.168.1.50:7987/?input=on","btn_off_url":"http://192.168.1.50:7987/?input=off","out_on_url":"http://192.168.1.50:7987/?onOffState=1","out_off_url":"http://192.168.1.50:7987/?onOffState=0","longpush_url":"http://192.168.1.50:7987/?input=long","shortpush_url":"http://192.168.1.50:7987/?input=short","schedule":false,"schedule_rules":[]}],"rollers":[{"maxtime":20.00,"maxtime_open":20.00,"maxtime_close":20.00,"default_state":"stop","swap":false,"swap_inputs":false,"input_mode":"openclose","button_type":"toggle","btn_reverse":0,"state":"stop","power":0.00,"is_valid":true,"safety_switch":false,"roller_open_url":null,"roller_close_url":null,"roller_stop_url":null,"schedule":false,"schedule_rules":[],"obstacle_mode":"disabled","obstacle_action":"stop","obstacle_power":200,"obstacle_delay":1,"safety_mode":"while_opening","safety_action":"stop","safety_allowed_on_trigger":"none","off_power":2,"positioning":true}],"meters":[{"power":0.00,"is_valid":true,"timestamp":1583937766,"counters":[0.000, 0.000, 0.000],"total":0},{"power":0.00,"is_valid":true,"timestamp":1583937766,"counters":[0.000, 0.000, 0.000],"total":0}]}, "status":{"wifi_sta":{"connected":true,"ssid":"xxx","ip":"192.168.1.108","rssi":-57},"cloud":{"enabled":false,"connected":false},"mqtt":{"connected":false},"time":"14:43","serial":1,"has_update":true,"mac":"2CF43268CFBB","relays":[{"ison":true,"has_timer":false,"overpower":false,"overtemperature":false,"is_valid":true},{"ison":true,"has_timer":false,"overpower":false,"overtemperature":false,"is_valid":true}],"meters":[{"power":0.00,"is_valid":true,"timestamp":1583937795,"counters":[0.000, 0.000, 0.000],"total":0},{"power":0.00,"is_valid":true,"timestamp":1583937795,"counters":[0.000, 0.000, 0.000],"total":0}],"inputs":[{"input":1},{"input":0}],"temperature":70.98,"overtemperature":false,"tmp":{"tC":70.98,"tF":159.77, "is_valid":"true"},"update":"status":"pending","has_update":true,"new_version":"20200309-104051/v1.6.0@43056d58","old_version":"20200206-083126/v1.5.10@e6a4205e"},"ram_total":49520,"ram_free":35120,"fs_size":233681,"fs_free":152357,"voltage":0.16,"uptime":311639}, "SHSW-1":{ "settings":{"device":{"type":"SHSW-1","mac":"98F4ABF3D3E5","hostname":"shelly1-F3D3E5","num_outputs":1},"wifi_ap":{"enabled":false,"ssid":"shelly1-F3D3E5","key":""},"wifi_sta":{"enabled":true,"ssid":"xxx","ipv4_method":"static","ip":"192.168.1.101","gw":"192.168.1.1","mask":"255.255.255.0","dns":null},"wifi_sta1":{"enabled":false,"ssid":null,"ipv4_method":"dhcp","ip":null,"gw":null,"mask":null,"dns":null},"mqtt": {"enable":false,"server":"192.168.33.3:1883","user":"","id":"shelly1-F3D3E5","reconnect_timeout_max":60.000000,"reconnect_timeout_min":2.000000,"clean_session":true,"keep_alive":60,"max_qos":0,"retain":false,"update_period":30},"sntp":{"server":"time.google.com","enabled":true},"login":{"enabled":false,"unprotected":false,"username":"admin","password":"admin"},"pin_code":"v)$v<l","name":"","fw":"20200206-083100/v1.5.10@e6a4205e","build_info":{"build_id":"20200206-083100/v1.5.10@e6a4205e","build_timestamp":"2020-02-06T08:31:00Z","build_version":"1.0"},"cloud":{"enabled":false,"connected":false},"timezone":"America/Chicago","lat":32.948299,"lng":-96.729897,"tzautodetect":true,"tz_utc_offset":-18000,"tz_dst":true,"tz_dst_auto":true,"time":"14:41","hwinfo":{"hw_revision":"prod-2019-08", "batch_id":0},"mode" :"relay","relays":[{"name":null,"ison":true,"has_timer":false,"default_state":"on","btn_type":"toggle","btn_reverse":0,"auto_on":0.00,"auto_off":0.00,"power":0.00,"btn_on_url":"http://192.168.1.50:7987/?input=on","btn_off_url":"http://192.168.1.50:7987/?input=off","out_on_url":"http://192.168.1.50:7987/?onOffState=1","out_off_url":"http://192.168.1.50:7987/?onOffState=0","longpush_url":"http://192.168.1.50:7987/?input=long","shortpush_url":"http://192.168.1.50:7987/?input=short","schedule":false,"schedule_rules":[]}]}, "status":{"wifi_sta":{"connected":true,"ssid":"xxx","ip":"192.168.1.101","rssi":-78},"cloud":{"enabled":false,"connected":false},"mqtt":{"connected":false},"time":"14:43","serial":1,"has_update":true,"mac":"98F4ABF3D3E5","relays" :[{"ison":true, "has_timer":false}],"meters":[{"power":0.00,"is_valid":"true"}],"inputs":[{"input":0}],"ext_temperature":{},"update":"status":"pending","has_update":true,"new_version":"20200309-104024/v1.6.0@43056d58","old_version":"20200206-083100/v1.5.10@e6a4205e"},"ram_total":50944,"ram_free":40300,"fs_size":233681,"fs_free":168923,"uptime":112752}, "SHSW-PM":{ "settings":{"device":{"type":"SHSW-PM","mac":"98F4ABB98AC2","hostname":"shelly1pm-B98AC2","num_outputs":1,"num_meters":1},"wifi_ap":{"enabled":false,"ssid":"shelly1pm-B98AC2","key":""},"wifi_sta":{"enabled":true,"ssid":"xxx","ipv4_method":"static","ip":"192.168.1.103","gw":"192.168.1.1","mask":"255.255.255.0","dns":null},"wifi_sta1":{"enabled":false,"ssid":null,"ipv4_method":"dhcp","ip":null,"gw":null,"mask":null,"dns":null},"mqtt": {"enable":false,"server":"192.168.33.3:1883","user":"","id":"shelly1pm-B98AC2","reconnect_timeout_max":60.000000,"reconnect_timeout_min":2.000000,"clean_session":true,"keep_alive":60,"max_qos":0,"retain":false,"update_period":30},"coiot": {"update_period":15},"sntp":{"server":"time.google.com","enabled":true},"login":{"enabled":false,"unprotected":false,"username":"admin","password":"admin"},"pin_code":"","name":"","fw":"20200309-104533/v1.6.0@43056d58","factory_reset_from_switch":true,"discoverable":true,"build_info":{"build_id":"20200309-104533/v1.6.0@43056d58","build_timestamp":"2020-03-09T10:45:33Z","build_version":"1.0"},"cloud":{"enabled":false,"connected":false},"timezone":"America/Chicago","lat":32.948299,"lng":-96.729897,"tzautodetect":true,"tz_utc_offset":-18000,"tz_dst":true,"tz_dst_auto":true,"time":"14:44","unixtime":1583937847,"hwinfo":{"hw_revision":"prod-2019-08", "batch_id":0},"max_power":3500,"power_correction":1.00,"mode" :"relay","longpush_time":800,"relays":[{"name":null,"ison":false,"has_timer":false,"default_state":"on","btn_type":"toggle","btn_reverse":0,"auto_on":0.00,"auto_off":0.00,"btn_on_url":"http://192.168.1.50:7987/?input=on","btn_off_url":"http://192.168.1.50:7987/?input=off","out_on_url":"http://192.168.1.50:7987/?onOffState=1","out_off_url":"http://192.168.1.50:7987/?onOffState=0","longpush_url":"http://192.168.1.50:7987/?input=long","shortpush_url":"http://192.168.1.50:7987/?input=short","schedule":false,"schedule_rules":[],"max_power":3500}],"meters":[{"power":0.00,"is_valid":true,"timestamp":1583937847,"counters":[0.000, 0.000, 0.000],"total":0}],"ext_sensors":{"temperature_unit":"C"},"ext_temperature":[{"overtemp_threshold_tC":0.0,"overtemp_threshold_tF":32.0,"undertemp_threshold_tC":0.0,"undertemp_threshold_tF":32.0,"overtemp_act":"disabled","undertemp_act":"disabled"},{"overtemp_threshold_tC":0.0,"overtemp_threshold_tF":32.0,"undertemp_threshold_tC":0.0,"undertemp_threshold_tF":32.0,"overtemp_act":"disabled","undertemp_act":"disabled"}],"ext_humidity":[]}, "status":{"wifi_sta":{"connected":true,"ssid":"xxx","ip":"192.168.1.103","rssi":-54},"cloud":{"enabled":false,"connected":false},"mqtt":{"connected":false},"time":"14:43","unixtime":1583937832,"serial":1,"has_update":false,"mac":"98F4ABB98AC2","relays" :[{"ison":false, "has_timer":false, "timer_remaining":0, "overpower":false}],"meters":[{"power":0.00,"is_valid":true,"timestamp":1583937832,"counters":[0.000, 0.000, 0.000],"total":0}],"inputs":[{"input":0}],"ext_sensors":{"temperature_unit":"C"},"ext_temperature":{"0":{"tC":23.06,"tF":73.51},"2":{"tC":23.06,"tF":73.51}},"ext_humidity":{},"temperature":48.67,"overtemperature":false,"tmp":{"tC":48.67,"tF":119.61, "is_valid":"true"},"update":"status":"idle","has_update":false,"new_version":"20200309-104533/v1.6.0@43056d58","old_version":"20200309-104533/v1.6.0@43056d58"},"ram_total":50328,"ram_free":38920,"fs_size":233681,"fs_free":151855,"uptime":113043}, "SHSW-25":{ "settings":{"device":{"type":"SHSW-25","mac":"2CF43268CFBB","hostname":"shellyswitch25-68CFBB","num_outputs":2, "num_meters":2, "num_rollers":1},"wifi_ap":{"enabled":false,"ssid":"shellyswitch25-68CFBB","key":""},"wifi_sta":{"enabled":true,"ssid":"xxx","ipv4_method":"static","ip":"192.168.1.108","gw":"192.168.1.1","mask":"255.255.255.0","dns":"192.168.1.1"},"wifi_sta1":{"enabled":false,"ssid":null,"ipv4_method":"dhcp","ip":null,"gw":null,"mask":null,"dns":null},"mqtt": {"enable":false,"server":"192.168.33.3:1883","user":"","id":"shellyswitch25-68CFBB","reconnect_timeout_max":60.000000,"reconnect_timeout_min":2.000000,"clean_session":true,"keep_alive":60,"max_qos":0,"retain":false,"update_period":30},"sntp":{"server":"time.google.com","enabled":true},"login":{"enabled":false,"unprotected":false,"username":"admin","password":"admin"},"pin_code":"","name":"","fw":"20200206-083126/v1.5.10@e6a4205e","build_info":{"build_id":"20200206-083126/v1.5.10@e6a4205e","build_timestamp":"2020-02-06T08:31:26Z","build_version":"1.0"},"cloud":{"enabled":false,"connected":false},"timezone":"America/Chicago","lat":32.948299,"lng":-96.729897,"tzautodetect":true,"tz_utc_offset":-18000,"tz_dst":true,"tz_dst_auto":true,"time":"14:41","hwinfo":{"hw_revision":"prod-2019-03", "batch_id":1},"mode":"relay","max_power":1840,"relays":[{"name":null,"ison":true,"has_timer":false,"overpower":false,"default_state":"off","btn_type":"edge","btn_reverse":1,"auto_on":0.00,"auto_off":0.00,"max_power":0,"btn_on_url":"http://192.168.1.50:7987/?input=on","btn_off_url":"http://192.168.1.50:7987/?input=off","out_on_url":"http://192.168.1.50:7987/?onOffState=1","out_off_url":"http://192.168.1.50:7987/?onOffState=0","longpush_url":"http://192.168.1.50:7987/?input=long","shortpush_url":"http://192.168.1.50:7987/?input=short","schedule":false,"schedule_rules":[]},{"name":null,"ison":true,"has_timer":false,"overpower":false,"default_state":"off","btn_type":"toggle","btn_reverse":0,"auto_on":0.00,"auto_off":0.00,"max_power":0,"btn_on_url":"http://192.168.1.50:7987/?input=on","btn_off_url":"http://192.168.1.50:7987/?input=off","out_on_url":"http://192.168.1.50:7987/?onOffState=1","out_off_url":"http://192.168.1.50:7987/?onOffState=0","longpush_url":"http://192.168.1.50:7987/?input=long","shortpush_url":"http://192.168.1.50:7987/?input=short","schedule":false,"schedule_rules":[]}],"rollers":[{"maxtime":20.00,"maxtime_open":20.00,"maxtime_close":20.00,"default_state":"stop","swap":false,"swap_inputs":false,"input_mode":"openclose","button_type":"toggle","btn_reverse":0,"state":"stop","power":0.00,"is_valid":true,"safety_switch":false,"roller_open_url":null,"roller_close_url":null,"roller_stop_url":null,"schedule":false,"schedule_rules":[],"obstacle_mode":"disabled","obstacle_action":"stop","obstacle_power":200,"obstacle_delay":1,"safety_mode":"while_opening","safety_action":"stop","safety_allowed_on_trigger":"none","off_power":2,"positioning":true}],"meters":[{"power":0.00,"is_valid":true,"timestamp":1583937677,"counters":[0.000, 0.000, 0.000],"total":0},{"power":0.00,"is_valid":true,"timestamp":1583937677,"counters":[0.000, 0.000, 0.000],"total":0}]}, "status":{"wifi_sta":{"connected":true,"ssid":"xxx","ip":"192.168.1.108","rssi":-56},"cloud":{"enabled":false,"connected":false},"mqtt":{"connected":false},"time":"14:40","serial":1,"has_update":true,"mac":"2CF43268CFBB","relays":[{"ison":true,"has_timer":false,"overpower":false,"overtemperature":false,"is_valid":true},{"ison":true,"has_timer":false,"overpower":false,"overtemperature":false,"is_valid":true}],"meters":[{"power":0.00,"is_valid":true,"timestamp":1583937618,"counters":[0.000, 0.000, 0.000],"total":0},{"power":0.00,"is_valid":true,"timestamp":1583937618,"counters":[0.000, 0.000, 0.000],"total":0}],"inputs":[{"input":1},{"input":0}],"temperature":70.81,"overtemperature":false,"tmp":{"tC":70.81,"tF":159.46, "is_valid":"true"},"update":"status":"pending","has_update":true,"new_version":"20200309-104051/v1.6.0@43056d58","old_version":"20200206-083126/v1.5.10@e6a4205e"},"ram_total":49520,"ram_free":36824,"fs_size":233681,"fs_free":152357,"voltage":0.16,"uptime":311462}, "SHBDUO-1":{ "settings":{"device":{"type":"SHBDUO-1","mac":"98F4ABD0D3D8","hostname":"ShellyBulbDuo-D0D3D8","num_outputs":1},"wifi_ap":{"enabled":false,"ssid":"ShellyBulbDuo-D0D3D8","key":""},"wifi_sta":{"enabled":true,"ssid":"xxx","ipv4_method":"static","ip":"192.168.1.111","gw":"192.168.1.1","mask":"255.255.255.0","dns":null},"wifi_sta1":{"enabled":false,"ssid":null,"ipv4_method":"dhcp","ip":null,"gw":null,"mask":null,"dns":null},"mqtt": {"enable":false,"server":"192.168.33.3:1883","user":"","id":"ShellyBulbDuo-D0D3D8","reconnect_timeout_max":60.000000,"reconnect_timeout_min":2.000000,"clean_session":true,"keep_alive":60,"max_qos":0,"retain":false,"update_period":30},"coiot": {"update_period":15},"sntp": {"server":"time.google.com"},"login":{"enabled":false,"unprotected":false,"username":"admin","password":"admin"},"pin_code":"","name":"","fw":"20200129-155730/master@a18bfaec","discoverable":true,"build_info":{"build_id":"20200129-155730/master@a18bfaec","build_timestamp":"2020-01-29T15:57:30Z","build_version":"1.0"},"cloud":{"enabled":false,"connected":false},"timezone":"America/Chicago","lat":500.000000,"lng":500.000000,"tzautodetect":true,"tz_utc_offset":-18000,"tz_dst":true,"tz_dst_auto":true,"time":"","hwinfo":{"hw_revision":"prod-2019-12","batch_id":0},"mode":"white","transition":1000,"lights":[{"ison":true,"brightness":100,"white":62,"temp":5056,"default_state":"on","auto_on":0.00,"auto_off":0.00,"schedule":false,"schedule_rules":[]}],"night_mode":{"enabled":0, "start_time":"00:00", "end_time":"00:00", "brightness":0}}, "status":{"wifi_sta":{"connected":true,"ssid":"xxx","ip":"192.168.1.111","rssi":-59},"cloud":{"enabled":false,"connected":false},"mqtt":{"connected":false},"time":"14:45","serial":1,"has_update":true,"mac":"98F4ABD0D3D8","lights":[{"ison":true,"brightness":100,"white":62,"temp":5056}],"meters":[{"power":9.00,"is_valid":"true"}],"update":"status":"pending","has_update":true,"new_version":"20200309-103933/v1.6.0@43056d58","old_version":"20200129-155730/master@a18bfaec"},"ram_total":50656,"ram_free":40408,"fs_size":233681,"fs_free":167417,"uptime":25}, "SHDM-1":{ "settings":{"device":{"type":"SHDM-1","mac":"98F4ABD0E474","hostname":"shellydimmer-D0E474","num_outputs":1,"num_meters":1},"wifi_ap":{"enabled":false,"ssid":"shellydimmer-D0E474","key":""},"wifi_sta":{"enabled":true,"ssid":"xxx","ipv4_method":"static","ip":"192.168.1.99","gw":"192.168.1.1","mask":"255.255.255.0","dns":null},"wifi_sta1":{"enabled":false,"ssid":null,"ipv4_method":"dhcp","ip":null,"gw":null,"mask":null,"dns":null},"mqtt": {"enable":false,"server":"192.168.33.3:1883","user":"","id":"shellydimmer-D0E474","reconnect_timeout_max":60.000000,"reconnect_timeout_min":2.000000,"clean_session":true,"keep_alive":60,"max_qos":0,"retain":false,"update_period":30},"coiot": {"update_period":15},"sntp":{"server":"time.google.com","enabled":true},"login":{"enabled":false,"unprotected":false,"username":"admin","password":"admin"},"pin_code":"","name":"","fw":"20200309-104554/v1.6.0@43056d58","factory_reset_from_switch":true,"discoverable":true,"build_info":{"build_id":"20200309-104554/v1.6.0@43056d58","build_timestamp":"2020-03-09T10:45:54Z","build_version":"1.0"},"cloud":{"enabled":false,"connected":false},"timezone":"America/Chicago","lat":32.948299,"lng":-96.729897,"tzautodetect":true,"tz_utc_offset":-18000,"tz_dst":true,"tz_dst_auto":true,"time":"14:46","unixtime":1583937972,"hwinfo":{"hw_revision":"dev-prototype","batch_id":0},"mode":"white","pulse_mode":2,"calibrated":false,"transition":1000,"fade_rate":3,"min_brightness":0,"lights":[{"name":"","ison":true,"default_state":"on","auto_on":0.00,"auto_off":0.00,"btn1_on_url":"http://192.168.1.50:7987/?input_0=on","btn1_off_url":"http://192.168.1.50:7987/?input_0=off","btn1_longpush_url":"http://192.168.1.50:7987/?input_0=long","btn1_shortpush_url":"http://192.168.1.50:7987/?input_0=short","btn2_on_url":"http://192.168.1.50:7987/?input_1=on","btn2_off_url":"http://192.168.1.50:7987/?input_1=off","btn2_longpush_url":"http://192.168.1.50:7987/?input_1=long","btn2_shortpush_url":"http://192.168.1.50:7987/?input_1=short","out_on_url":"http://192.168.1.50:7987/?onOffState=1","out_off_url":"http://192.168.1.50:7987/?onOffState=0","schedule":false,"schedule_rules":[],"btn_type":"detached","btn_debounce":80,"swap_inputs":1}],"night_mode":{"enabled":0, "start_time":"00:00", "end_time":"00:00", "brightness":0}}, "status":{"wifi_sta":{"connected":true,"ssid":"xxx","ip":"192.168.1.99","rssi":-59},"cloud":{"enabled":false,"connected":false},"mqtt":{"connected":false},"time":"14:45","unixtime":1583937951,"serial":1,"has_update":false,"mac":"98F4ABD0E474","lights":[{"ison":true,"has_timer":false,"timer_remaining":0,"mode":"white","brightness":100}],"meters":[{"power":0.00, "is_valid":true, "timestamp":1583937951,"counters":[0.000, 0.000, 0.000],"total":0}],"inputs":[{"input":0},{"input":0}],"tmp":{"tC":44.50,"tF":112.10, "is_valid":"true"},"calib_progress":0,"overtemperature":false,"loaderror":false,"overload":false,"update":"status":"idle","has_update":false,"new_version":"20200309-104554/v1.6.0@43056d58","old_version":"20200309-104554/v1.6.0@43056d58"},"ram_total":48112,"ram_free":36444,"fs_size":233681,"fs_free":132528,"uptime":6368}, "SHEM":{ "settings":{"device":{"type":"SHEM","mac":"A4CF12B9E6BA","hostname":"shellyem-B9E6BA","num_outputs":1, "num_meters": 0, "num_emeters":2},"wifi_ap":{"enabled":false,"ssid":"shellyem-B9E6BA","key":""},"wifi_sta":{"enabled":true,"ssid":"xxx","ipv4_method":"static","ip":"192.168.1.100","gw":"192.168.1.1","mask":"255.255.255.0","dns":null},"wifi_sta1":{"enabled":false,"ssid":null,"ipv4_method":"dhcp","ip":null,"gw":null,"mask":null,"dns":null},"mqtt": {"enable":false,"server":"192.168.33.3:1883","user":"","id":"shellyem-B9E6BA","reconnect_timeout_max":60.000000,"reconnect_timeout_min":2.000000,"clean_session":true,"keep_alive":60,"max_qos":0,"retain":false,"update_period":30},"coiot": {"update_period":15},"sntp":{"server":"time.google.com","enabled":true},"login":{"enabled":false,"unprotected":false,"username":"admin","password":"admin"},"pin_code":"","name":"","fw":"20200309-104606/v1.6.0@43056d58","discoverable":true,"build_info":{"build_id":"20200309-104606/v1.6.0@43056d58","build_timestamp":"2020-03-09T10:46:06Z","build_version":"1.0"},"cloud":{"enabled":false,"connected":false},"timezone":"America/Chicago","lat":32.948299,"lng":-96.729897,"tzautodetect":true,"tz_utc_offset":-18000,"tz_dst":true,"tz_dst_auto":true,"time":"14:48","unixtime":1583938109,"dual_phases_mode":false,"hwinfo":{"hw_revision":"prod-2019-06", "batch_id":0},"max_power":0,"relays":[{"name":null,"ison":false,"has_timer":false,"overpower":false,"default_state":"off","auto_on":0.00,"auto_off":0.00,"max_power":0,"out_on_url":"http://192.168.1.50:7987/?relay=1","out_off_url":"http://192.168.1.50:7987/?relay=0","schedule":false,"schedule_rules":[]}],"emeters":[{"ctraf_type":50},{"ctraf_type":50}]}, "status":{"wifi_sta":{"connected":true,"ssid":"xxx","ip":"192.168.1.100","rssi":-51},"cloud":{"enabled":false,"connected":false},"mqtt":{"connected":false},"time":"14:48","unixtime":1583938087,"serial":1,"has_update":false,"mac":"A4CF12B9E6BA","relays":[{"ison":false,"has_timer":false,"timer_remaining":0,"overpower":false,"is_valid":true}],"emeters":[{"power":0.00,"reactive":0.00,"voltage":117.24,"is_valid":true,"total":0.0,"total_returned":0.0},{"power":0.00,"reactive":0.00,"voltage":117.24,"is_valid":true,"total":0.0,"total_returned":0.0}],"update":"status":"idle","has_update":false,"new_version":"20200309-104606/v1.6.0@43056d58","old_version":"20200309-104606/v1.6.0@43056d58"},"ram_total":49744,"ram_free":35940,"fs_size":233681,"fs_free":160891,"uptime":113236}, "SHRGBW2":{ "settings":{"device":{"type":"SHRGBW2","mac":"500291B0979D","hostname":"shellyrgbw2-B0979D","num_outputs":4},"wifi_ap":{"enabled":false,"ssid":"shellyrgbw2-B0979D","key":""},"wifi_sta":{"enabled":true,"ssid":"xxx","ipv4_method":"static","ip":"192.168.1.107","gw":"192.168.1.1","mask":"255.255.255.0","dns":null},"wifi_sta1":{"enabled":false,"ssid":null,"ipv4_method":"dhcp","ip":null,"gw":null,"mask":null,"dns":null},"mqtt": {"enable":false,"server":"192.168.33.3:1883","user":"","id":"shellyrgbw2-B0979D","reconnect_timeout_max":60.000000,"reconnect_timeout_min":2.000000,"clean_session":true,"keep_alive":60,"max_qos":0,"retain":false,"update_period":30},"coiot": {"update_period":15},"sntp":{"server":"time.google.com","enabled":true},"login":{"enabled":false,"unprotected":false,"username":"admin","password":"admin"},"pin_code":"","name":"","fw":"20200309-104453/v1.6.0@43056d58","factory_reset_from_switch":true,"discoverable":true,"build_info":{"build_id":"20200309-104453/v1.6.0@43056d58","build_timestamp":"2020-03-09T10:44:53Z","build_version":"1.0"},"cloud":{"enabled":false,"connected":false},"timezone":"America/Chicago","lat":32.948299,"lng":-96.729897,"tzautodetect":true,"tz_utc_offset":-18000,"tz_dst":true,"tz_dst_auto":true,"time":"14:48","unixtime":1583938133,"hwinfo": {"hw_revision":"prod-190822","batch_id":1},"mode":"color","dcpower":1,"lights":[{"ison":true,"red":255,"green":0,"blue":0,"white":0,"gain":100,"effect":0,"default_state":"on","auto_on":0.00,"auto_off":0.00,"schedule":false,"btn_type":"toggle","btn_reverse":0,"schedule_rules":[]}]}, "status":{"wifi_sta":{"connected":true,"ssid":"xxx","ip":"192.168.1.107","rssi":-52},"cloud":{"enabled":false,"connected":false},"mqtt":{"connected":false},"time":"14:49","unixtime":1583938152,"serial":1,"has_update":false,"mac":"500291B0979D","mode":"color","input":0,"lights":[{"ison":true,"has_timer":false,"timer_remaining":0,"mode":"color","red":255,"green":0,"blue":0,"white":0,"gain":100,"effect":0,"power":0.46,"overpower":false}],"meters":[{"power":0.46,"is_valid":true}],"update":"status":"idle","has_update":false,"new_version":"20200309-104453/v1.6.0@43056d58","old_version":"20200309-104453/v1.6.0@43056d58"},"ram_total":49744,"ram_free":37748,"fs_size":233681,"fs_free":155871,"uptime":113335}, "SHBLB-1":{ "settings":{"device":{"type":"SHBLB-1","mac":"68C63ABC84C3","hostname":"shellybulb-BC84C3","num_outputs":1},"wifi_ap":{"enabled":false,"ssid":"shellybulb-BC84C3","key":""},"wifi_sta":{"enabled":true,"ssid":"xxx","ipv4_method":"static","ip":"192.168.1.106","gw":"192.168.1.1","mask":"255.255.255.0","dns":null},"wifi_sta1":{"enabled":false,"ssid":null,"ipv4_method":"dhcp","ip":null,"gw":null,"mask":null,"dns":null},"mqtt": {"enable":false,"server":"192.168.33.3:1883","user":"","id":"shellybulb-BC84C3","reconnect_timeout_max":60.000000,"reconnect_timeout_min":2.000000,"clean_session":true,"keep_alive":60,"max_qos":0,"retain":false,"update_period":30},"coiot": {"update_period":15},"sntp":{"server":"time.google.com","enabled":true},"login":{"enabled":false,"unprotected":false,"username":"admin","password":"admin"},"pin_code":"","name":"","fw":"20200309-103907/v1.6.0@43056d58","discoverable":true,"build_info":{"build_id":"20200309-103907/v1.6.0@43056d58","build_timestamp":"2020-03-09T10:39:07Z","build_version":"1.0"},"cloud":{"enabled":false,"connected":false},"timezone":"America/Chicago","lat":32.948299,"lng":-96.729897,"tzautodetect":true,"tz_utc_offset":-18000,"tz_dst":true,"tz_dst_auto":true,"time":"14:49","unixtime":1583938179,"hwinfo": {"hw_revision":"prod-1.3","batch_id":1},"mode":"white","lights":[{"ison":true,"red":255,"green":255,"blue":255,"white":1,"gain":100,"temp":4500,"brightness":100,"effect":5,"default_state":"on","auto_on":0.00,"auto_off":0.00,"power":0.00,"schedule":false,"schedule_rules":[]}]}, "status":{"wifi_sta":{"connected":true,"ssid":"xxx","ip":"192.168.1.106","rssi":-64},"cloud":{"enabled":false,"connected":false},"mqtt":{"connected":false},"time":"14:49","unixtime":1583938168,"serial":1,"has_update":false,"mac":"68C63ABC84C3","lights":[{"ison":true,"has_timer":false,"timer_remaining":0,"mode":"white","red":255,"green":255,"blue":255,"white":1,"gain":100,"temp":4500,"brightness":100,"effect":5}],"meters":[{"power":0.00,"is_valid":"true"}],"update":"status":"idle","has_update":false,"new_version":"20200309-103907/v1.6.0@43056d58","old_version":"20200309-103907/v1.6.0@43056d58"},"ram_total":50816,"ram_free":40032,"fs_size":233681,"fs_free":164907,"uptime":280}, "SHHT-1":{ "settings":{"device":{"type":"SHHT-1","mac":"98F4ABF36D0E","hostname":"shellyht-F36D0E","sleep_mode":true},"wifi_ap":{"enabled":false,"ssid":"shellyht-F36D0E","key":""},"wifi_sta":{"enabled":true,"ssid":"xxx","ipv4_method":"static","ip":"192.168.1.102","gw":"192.168.1.99","mask":"255.255.255.0","dns":"192.168.1.99"},"wifi_sta1":{"enabled":false,"ssid":null,"ipv4_method":"dhcp","ip":null,"gw":null,"mask":null,"dns":null},"mqtt": {"enable":false,"server":"192.168.33.3:1883","user":"","id":"shellyht-F36D0E","reconnect_timeout_max":60.000000,"reconnect_timeout_min":2.000000,"clean_session":true,"keep_alive":60,"max_qos":0,"retain":false,"update_period":30},"sntp": {"server":"time.google.com"},"login":{"enabled":false,"unprotected":false,"username":"admin","password":"admin"},"pin_code":"}vU&hU","name":"","fw":"20191216-090428/v1.5.7@c30657ba","build_info":{"build_id":"20191216-090428/v1.5.7@c30657ba","build_timestamp":"2019-12-16T09:04:28Z","build_version":"1.0"},"cloud":{"enabled":false,"connected":false},"timezone":"America/Chicago","lat":500.000000,"lng":500.000000,"tzautodetect":true,"time":"","sensors":{"temperature_threshold":1.0,"temperature_unit":"C","humidity_threshold":5.0},"sleep_mode":{"period":12,"unit":"h"},"report_url":"http://192.168.1.50:7987/data?","external_power":0,"temperature_offset":0.0,"humidity_offset":0.0}, "status":{"wifi_sta":{"connected":true,"ssid":"xxx","ip":"192.168.1.102","rssi":-58},"cloud":{"enabled":false,"connected":false},"mqtt":{"connected":false},"time":"","serial":1,"has_update":false,"mac":"98F4ABF36D0E","is_valid":true,"tmp":{"value":24.62,"units":"C","tC":24.62,"tF":76.32, "is_valid":true},"hum":{"value":54.0, "is_valid":true},"bat":{"value":100,"voltage":2.98},"act_reasons":["button"],"connect_retries":0,"update":"status":"unknown","has_update":false,"new_version":"","old_version":"20191216-090428/v1.5.7@c30657ba"},"ram_total":50600,"ram_free":40432,"fs_size":233681,"fs_free":160640,"uptime":15}, "SHWT-1":{ "settings":{"device":{"type":"SHWT-1","mac":"DC4F22764F81","hostname":"shellyflood-764F81","sleep_mode":true},"wifi_ap":{"enabled":false,"ssid":"shellyflood-764F81","key":""},"wifi_sta":{"enabled":true,"ssid":"xxx","ipv4_method":"static","ip":"192.168.1.105","gw":"192.168.1.1","mask":"255.255.255.0","dns":null},"wifi_sta1":{"enabled":false,"ssid":null,"ipv4_method":"dhcp","ip":null,"gw":null,"mask":null,"dns":null},"mqtt": {"enable":false,"server":"192.168.33.3:1883","user":"","id":"shellyflood-764F81","reconnect_timeout_max":60.000000,"reconnect_timeout_min":2.000000,"clean_session":true,"keep_alive":60,"max_qos":0,"retain":false,"update_period":30},"coiot": {"update_period":15},"sntp":{"server":"time.google.com","enabled":true},"login":{"enabled":false,"unprotected":false,"username":"admin","password":"admin"},"pin_code":"","name":"","fw":"20200309-104406/v1.6.0@43056d58","discoverable":true,"build_info":{"build_id":"20200309-104406/v1.6.0@43056d58","build_timestamp":"2020-03-09T10:44:06Z","build_version":"1.0"},"cloud":{"enabled":false,"connected":false},"timezone":"America/Chicago","lat":500.000000,"lng":500.000000,"tzautodetect":true,"tz_utc_offset":-18000,"tz_dst":true,"tz_dst_auto":true,"time":"","unixtime":0,"sensors":{"temperature_threshold":1.0,"temperature_unit":"C"},"sleep_mode":{"period":12,"unit":"h"}, "report_url":"http://192.168.1.50:7987/data?", "flood_detected_url":"", "flood_gone_url":"", "rain_sensor":false}, "status":{"wifi_sta":{"connected":true,"ssid":"xxx","ip":"192.168.1.105","rssi":-62},"cloud":{"enabled":false,"connected":false},"mqtt":{"connected":false},"time":"14:47","unixtime":1583938062,"serial":1,"has_update":false,"mac":"DC4F22764F81","is_valid":true,"flood":false,"tmp":{"value":24.00,"units":"C","tC":24.00,"tF":75.20, "is_valid":true},"bat":{"value":100,"voltage":3.01},"act_reasons":["button"], "rain_sensor":false,"update":"status":"idle","has_update":false,"new_version":"20200309-104406/v1.6.0@43056d58","old_version":"20200309-104406/v1.6.0@43056d58"},"ram_total":50424,"ram_free":40204,"fs_size":233681,"fs_free":148341,"uptime":53} }

On Mar 11, 2020, at 15:14, Aaron notifications@github.com wrote:

I did the same with the Shelly 2.5. I determined that that device is pretty much two Shelly 1PM's in a single enclosure. So my Shelly 2.5 Indigo device represent half of a Shelly 2.5 and is modeled after the Shelly 1PM. My 2.5 device lets the user specify the "channel" as channel 0 or 1 to identify which relay they will control. I decided to just group a single switch with a single relay.

Channel x

Each device subscribes to these topics with a 0 or 1 as the x shellies/shellyswitch25-/input/x for each SW input x shellies/shellyswitch25-/longpush/x for each SW input x; reports a value indicating longpush state as 0 or 1 shellies/shellyswitch25-/relay/x for each relay x shellies/shellyswitch25-/relay/x/command for each relay x shellies/shellyswitch25-/relay/x/power for each relay x shellies/shellyswitch25-/relay/x/energy for each relay x

Both devices

Both of the indigo devices for a single 2.5 relay will subscribe to these topics since the internal temperature is shared between the two. shellies/shellyswitch25-/temperature reports internal device temperature in °C shellies/shellyswitch25-/overtemperature reports 1 when device has overheated, normally 0

Numbering

As for the numbering, they use zero-indexing internally, but just use 1-indexing since that is more user-friendly. I simply just did the following in my "channel selection" part of the device config:

So the user is presented with 1-based indexing and internally I automatically get 0-based indexing.

I actually decided that internally, all devices have "channels", even though the majority of devices are a single channel. These single channel devices have the Chanel selection hidden and just default to 0. My architecture then allows me to build devices off of one another without rewriting too much code (and introducing "undesired features").

For example, my Shelly 2.5 device allows the user to select a channel and only has 30 lines of code since it inherits almost all features from the Shelly 1PM (which inherits the majority of its code from the Shelly 1... and it keeps going). https://github.com/AaronLionsheep/ShellyMQTT/blob/0.6.0/ShellyMQTT.indigoPlugin/Contents/Server%20Plugin/Devices/Relays/Shelly_2_5_Relay.py

If you're interested, take a look at how I was able to structure my device implementations. It seems that most of the Shelly devices are actually built on top of each other, so I tried to model my code this way too.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

kw123 commented 4 years ago

returning the favor

    # Set icon based on the online status
    if self.device.states.get('online', True):
        self.device.updateStateImageOnServer(indigo.kStateImageSel.TemperatureSensorOn)
    else:
        self.device.updateStateImageOnServer(indigo.kStateImageSel.TemperatureSensorOn)

the second should be Off not On in DHT as well as onewire

impressive code I have a long way to go

Karl

On Mar 11, 2020, at 15:14, Aaron notifications@github.com wrote:

I did the same with the Shelly 2.5. I determined that that device is pretty much two Shelly 1PM's in a single enclosure. So my Shelly 2.5 Indigo device represent half of a Shelly 2.5 and is modeled after the Shelly 1PM. My 2.5 device lets the user specify the "channel" as channel 0 or 1 to identify which relay they will control. I decided to just group a single switch with a single relay.

Channel x

Each device subscribes to these topics with a 0 or 1 as the x shellies/shellyswitch25-/input/x for each SW input x shellies/shellyswitch25-/longpush/x for each SW input x; reports a value indicating longpush state as 0 or 1 shellies/shellyswitch25-/relay/x for each relay x shellies/shellyswitch25-/relay/x/command for each relay x shellies/shellyswitch25-/relay/x/power for each relay x shellies/shellyswitch25-/relay/x/energy for each relay x

Both devices

Both of the indigo devices for a single 2.5 relay will subscribe to these topics since the internal temperature is shared between the two. shellies/shellyswitch25-/temperature reports internal device temperature in °C shellies/shellyswitch25-/overtemperature reports 1 when device has overheated, normally 0

Numbering

As for the numbering, they use zero-indexing internally, but just use 1-indexing since that is more user-friendly. I simply just did the following in my "channel selection" part of the device config:

So the user is presented with 1-based indexing and internally I automatically get 0-based indexing.

I actually decided that internally, all devices have "channels", even though the majority of devices are a single channel. These single channel devices have the Chanel selection hidden and just default to 0. My architecture then allows me to build devices off of one another without rewriting too much code (and introducing "undesired features").

For example, my Shelly 2.5 device allows the user to select a channel and only has 30 lines of code since it inherits almost all features from the Shelly 1PM (which inherits the majority of its code from the Shelly 1... and it keeps going). https://github.com/AaronLionsheep/ShellyMQTT/blob/0.6.0/ShellyMQTT.indigoPlugin/Contents/Server%20Plugin/Devices/Relays/Shelly_2_5_Relay.py https://github.com/AaronLionsheep/ShellyMQTT/blob/0.6.0/ShellyMQTT.indigoPlugin/Contents/Server%20Plugin/Devices/Relays/Shelly_2_5_Relay.py If you're interested, take a look at how I was able to structure my device implementations. It seems that most of the Shelly devices are actually built on top of each other, so I tried to model my code this way too.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kw123/SHELLY/issues/1#issuecomment-597844621, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEH2SNFQGLBNVACXEAJ4BPTRG7WKLANCNFSM4LFUTKNA.

kw123 commented 4 years ago

Trump just cancelled all travel and cargo plane from europe. I am waiting for my shelly shipment from Bulgaria.. I guess no new toys for a month

AaronLionsheep commented 4 years ago

If it makes you feel any better, I had to use both Fotran and Ada in my last homework assignment for one of my classes. However, my assignment was graded on a 24 node cluster with a total of 960 cores and about 2.2 TB of ram, we've come a long way!

I definitely understand where your style comes from! I have tried to read through some of your other plugins a while back and didn't get very far before my brain had enough.


I had originally planned to use the on/off variants of icons to reflect the online status of devices. For example, the Shelly HT only comes online twice per day, so a grey temperature icon would let the user know that the data could be old. However, it seems like a lot of icons are not "available" in the Indigo UI. I set both of those to "On" icons because the off icon is missing and just defaults to a grey orb.

It seems that a lot of colleges are now moving all classes online. Mine has just done the same today. I'm in my 4th year and I have one semester left in the fall. Maybe I can get one last "normal" semester by then...

Which devices have your ordered from Bulgaria?

kw123 commented 4 years ago

You As a former Cio ... if you need some advice, want to run something by me please don’t hesitate. If not fine too

I ordered some of the light bulbs you can’t get in the us, the window sensor But shipping is March 30, they want send things together.

And I just learned cargo is not blocked.

Karl

On Mar 11, 2020, at 21:50, Aaron notifications@github.com wrote:

 If it makes you feel any better, I had to use both Fotran and Ada in my last homework assignment for one of my classes. However, my assignment was graded on a 24 node cluster with a total of 960 cores and about 2.2 TB of ram, we've come a long way!

I definitely understand where your style comes from! I have tried to read through some of your other plugins a while back and didn't get very far before my brain had enough.

I had originally planned to use the on/off variants of icons to reflect the online status of devices. For example, the Shelly HT only comes online twice per day, so a grey temperature icon would let the user know that the data could be old. However, it seems like a lot of icons are not "available" in the Indigo UI. I set both of those to "On" icons because the off icon is missing and just defaults to a grey orb.

It seems that a lot of colleges are now moving all classes online. Mine has just done the same today. I'm in my 4th year and I have one semester left in the fall. Maybe I can get one last "normal" semester by then...

Which devices have your ordered from Bulgaria?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

AaronLionsheep commented 4 years ago

Thanks for the offer - I will keep that in mind!

I will be testing with the latest Shelly Duo firmware tomorrow. I think temperature control seems to be supported now (the device would even crash/reboot if you sent temperature data over MQTT sometimes). The Shelly Plug and PlugS seem very interesting, but they only come with the EU-style plugs. Maybe we will se a US-style version in the coming months.

Also, I read somewhere in your documentation that you were looking to add support for the Shelly Button. I misunderstood this product at a glance too, but the Button is just an enclosure for the Shelly 1 and 1PM. It lets you splice the wires to a small appliance cable in order to contain the Shelly device neatly.

AaronLionsheep commented 4 years ago

I'm not sure if you saw, but Shelly released new firmware on Monday and updated their API page as well. They had a lot of devices missing before. Here is the API for the Door/Window if you'd like to get a head start: https://shelly-api-docs.shelly.cloud/#shelly-door-window-overview

kw123 commented 4 years ago

Yes, the button is just plastic and some wires. Have removed that. But it actually works fine for eg an inline switch

I am thinking of ordering a 220v plug .. as I came from Germany I still have some 220v devices and transformers

Karl

On Mar 11, 2020, at 22:19, Aaron notifications@github.com wrote:

 Thanks for the offer - I will keep that in mind!

I will be testing with the latest Shelly Duo firmware tomorrow. I think temperature control seems to be supported now (the device would even crash/reboot if you sent temperature data over MQTT sometimes). The Shelly Plug and PlugS seem very interesting, but they only come with the EU-style plugs. Maybe we will se a US-style version in the coming months.

Also, I read somewhere in your documentation that you were looking to add support for the Shelly Button. I misunderstood this product at a glance too, but the Button is just an enclosure for the Shelly 1 and 1PM. It lets you splice the wires to a small appliance cable in order to contain the Shelly device neatly.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

kw123 commented 4 years ago

.. and my brain is still thinking in a linear way —can do several at the same time— but the class stuff with inheritance ... is still alien to me And with 62 I will need some free time to really get into it I am a fan of just get it done and there should be some hardware involved.

Karl

On Mar 11, 2020, at 22:20, Aaron notifications@github.com wrote:

 I'm not sure if you saw, but Shelly released new firmware on Monday and updated their API page as well. They had a lot of devices missing before. Here is the API for the Door/Window if you'd like to get a head start: https://shelly-api-docs.shelly.cloud/#shelly-door-window-overview

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

kw123 commented 4 years ago

ordered from the EU store

On Mar 11, 2020, at 22:20, Aaron notifications@github.com wrote:

I'm not sure if you saw, but Shelly released new firmware on Monday and updated their API page as well. They had a lot of devices missing before. Here is the API for the Door/Window if you'd like to get a head start: https://shelly-api-docs.shelly.cloud/#shelly-door-window-overview https://shelly-api-docs.shelly.cloud/#shelly-door-window-overview — You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kw123/SHELLY/issues/1#issuecomment-597986466, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEH2SNFDUPMZURTRZBUZR23RHBIJFANCNFSM4LFUTKNA.

kw123 commented 4 years ago

That’s new. Thanks

Missing is the dev type. I use that for the indigo dev. deviceTypeId

Karl

On Mar 11, 2020, at 22:20, Aaron notifications@github.com wrote:

 I'm not sure if you saw, but Shelly released new firmware on Monday and updated their API page as well. They had a lot of devices missing before. Here is the API for the Door/Window if you'd like to get a head start: https://shelly-api-docs.shelly.cloud/#shelly-door-window-overview

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

AaronLionsheep commented 4 years ago

From the information that CliveS has provided me (he already has a Shelly Door/Window), it looks like they call it shellydw.

shellies/shellydw-F3B5E0/sensor/battery is from one of the topics that has device is subscribing to.

kw123 commented 4 years ago

Hi Aron,

sending from my isolated house, no cinema is open, the supermarkets have a long wait for home delivery (too much demand) ..

My version is now ready. Fully automatic — but less elegant than yours. But it works, recognizes all devices, can add devices manually, change ip … the external sensors are now their own devices linked to the “host”. Managing that was a little challenging ie when things change, del host, del child , change IP# ..

I looked at your info on the window device. shellies/shellydw-F3B5E0/ The tag seems to not have the right format should be like : SHDM-1 , SHRGBW2 .. The /settings returns eg "settings":{"device":{"type":"SHDM-1","mac":"98F4ABD0E474","hostname":"shellydimmer-D0E474”,”… I use the “type” field for the key, I could, for the time being, use the hostname bf the “-“ = shellydimmer, but I can’t test it anyway

So guess I have to wait .

Karl

ps after the last firmware update the “ACTION button on the SW-25 disappeared. the actions and settings still work though the PM! .. after upgrade is still fine.

They send update faster than once a week. good on one side, but it shows its not yet very mature. .. but thats the fun part of it.

On Mar 11, 2020, at 22:20, Aaron notifications@github.com wrote:

I'm not sure if you saw, but Shelly released new firmware on Monday and updated their API page as well. They had a lot of devices missing before. Here is the API for the Door/Window if you'd like to get a head start: https://shelly-api-docs.shelly.cloud/#shelly-door-window-overview https://shelly-api-docs.shelly.cloud/#shelly-door-window-overview — You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kw123/SHELLY/issues/1#issuecomment-597986466, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEH2SNFDUPMZURTRZBUZR23RHBIJFANCNFSM4LFUTKNA.

AaronLionsheep commented 4 years ago

Congratulations on your release! I also found managing host/children devices to be tricky. I ended up keeping a "dependency" list when a child would start before a parent. Then I could have the parent start its children after it has started up.

I guess I only have the hostname for the device as that is what my plugin uses to identify individual devices. I'm not using the device type for my internal naming, so hopefully that doesn't hurt me later. I haven't seen a good way to migrate old devices to a new device after changing the device type in the plugin.

As long as the postman keeps delivering new Shelly devices to your door, you'll be fine, right? 😃

kw123 commented 4 years ago

i started with an internal table [indigo devID], that is managed all quick things and lookups.. and it has the IP number

a child device has the same IP# and should not send or receive messages, ==> they are not in that dict… (that was may be a mistake) and then like you there is a device prop[“children”] that has a json of {devtypeOfChildren:{childno:indigodevId}} with (child No “1” .. “x” for shell25 as well s ext temp sensors and devtypeOfChildren =in [ shelly25, ext_temperature]

so the plugin now can handle:

  1. ip# changes
  2. delete and recreate children manually or for ext_temp automatically
  3. (un) ignore IP# = shelly devs

Karl ps I don’t like that you can not store dicts in props only strings, so i need to json.loads and dumps every time i read /write them (i am still very frugal w cpu/memory from my 32KB time.. and fortranIV had no if then else, but if goto # )

and it seems that the valuesDict in validateDeviceConfigUi can not be set to integers , only strings and True/False .. when I set valuesDict[“abc”] = 3 in validateDeviceConfigUi ; I would expect the the dev.pluginProps[“abc] is 3, but it is “3"

On Mar 15, 2020, at 09:09, Aaron notifications@github.com wrote:

Congratulations on your release! I also found managing host/children devices to be tricky. I ended up keeping a "dependency" list when a child would start before a parent. Then I could have the parent start its children after it has started up.

I guess I only have the hostname for the device as that is what my plugin uses to identify individual devices. I'm not using the device type for my internal naming, so hopefully that doesn't hurt me later. I haven't seen a good way to migrate old devices to a new device after changing the device type in the plugin.

As long as the postman keeps delivering new Shelly devices to your door, you'll be fine, right? 😃

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kw123/SHELLY/issues/1#issuecomment-599215200, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEH2SNHKF7G7F2KHM3MX77DRHTORDANCNFSM4LFUTKNA.

kw123 commented 4 years ago

Hi Aron Just published my version. Did a full week of testing and adding new devices is actually pretty easy now: Adding a dict and adding a device.xml section plus extra states that are available.. added the EM3 in 15 minutes

Still waiting for the Shelly shipments from Bulgaria.

We are just in our house and only go out for shopping. Stay safe

Karl

On Mar 14, 2020, at 14:44, karl wachs karlwachs@me.com wrote:

Hi Aron,

sending from my isolated house, no cinema is open, the supermarkets have a long wait for home delivery (too much demand) ..

My version is now ready. Fully automatic — but less elegant than yours. But it works, recognizes all devices, can add devices manually, change ip … the external sensors are now their own devices linked to the “host”. Managing that was a little challenging ie when things change, del host, del child , change IP# ..

I looked at your info on the window device. shellies/shellydw-F3B5E0/ The tag seems to not have the right format should be like : SHDM-1 , SHRGBW2 .. The /settings returns eg "settings":{"device":{"type":"SHDM-1","mac":"98F4ABD0E474","hostname":"shellydimmer-D0E474”,”… I use the “type” field for the key, I could, for the time being, use the hostname bf the “-“ = shellydimmer, but I can’t test it anyway

So guess I have to wait .

Karl

ps after the last firmware update the “ACTION button on the SW-25 disappeared. the actions and settings still work though the PM! .. after upgrade is still fine.

They send update faster than once a week. good on one side, but it shows its not yet very mature. .. but thats the fun part of it.

On Mar 11, 2020, at 22:20, Aaron notifications@github.com wrote:

I'm not sure if you saw, but Shelly released new firmware on Monday and updated their API page as well. They had a lot of devices missing before. Here is the API for the Door/Window if you'd like to get a head start: https://shelly-api-docs.shelly.cloud/#shelly-door-window-overview

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.