[APP][Pro&Cloud] Shelly

image

Control Shelly devices with Homey

  • Description: This Homey app allows you to control a wide variety of Shelly devices.
  • App Store Page: Shelly App for Homey | Homey (changelog is at the bottom)

Pairing with Homey (Pro)

Pairing instructions WiFi devices with Homey (Pro)

View the pairing instructions
  1. Add your Shelly device to the official Shelly smartphone app;
  2. Update the Shelly to the latest device firmware version by first connecting it to the Shelly cloud and then checking for a new firmware version. You can disable cloud connection afterwards if you do not need it. The pairing wizard will stall with a white screen if you have not updated to a recent firmware version;
  3. Then pair your Shelly device in Homey. The Shelly app for Homey uses mDNS discovery for finding your Shelly device(s) on your network. If you are unable to find your Shelly device using mDNS discovery even though it’s connected to your network you can try to reboot the Shelly from it’s webinterface and possible even Homey and try again or manually pair it using it’s IP address;
  4. If you have configured a username and password you are asked to enter these as well during pairing.
  5. If it is a battery operated device make sure to keep it awake during pairing. Read the device user manual how to wake the device (usually by single pressing a button inside a pinhole or inside the device). The pairing wizard will stall with a white screen if you do not keep it awake correctly;
  6. After confirmation your Shelly device is paired and you are good to go.

Pairing instructions Bluetooth (BLU) devices with Homey (Pro)

View the pairing instructions

Please be aware, Shelly BLU devices only work properly with Homey if you also have a Plus/Pro device connected to Homey which can serve as a Bluetooth Proxy. The Bluetooth implementation of Homey isn’t sufficient as it’s not properly implemented.

  1. Pair the Shelly BLU device with the official Shelly app and update the firmware if needed.
  2. Afterwards pair your Shelly BLU device with Homey using the Bluetooth device driver. Make sure you have the device close to Homey during pairing;
  3. When the device discovery process is running send a Bluetooth signal from the device, for instance by pressing a button on the device;
  4. Repeat step 1 and 2 until your device is discovered and pair it;
  5. Open the advanced device settings of a paired Plus/Pro device in Homey;
  6. Click the maintenance action for enabling the BLE Proxy on that Plus/Pro device.
  7. Repeat step 4 and 5 for any other Plus/Pro device which you would like to use as a Bluetooth proxy.
  8. Check all the Plus/Pro devices you have configured as Bluetooth Proxy to see if Bluetooth is enabled and Bluetooth Gateway is disabled. If you make changes, reboot the Plus/Pro afterwards.
  9. If you plan to use your Shelly BLU device as a presence beacon you will need to enable beacon mode on the Shelly BLU device using the Shelly BLE Debug smartphone app. Look it up in your mobile app store. You can also customize the beacon presence timeout value (time after last detection before marked as away) under the Shelly BLU device settings in Homey.

Pairing with Homey Cloud

Pairing instructions Gen1/Gen2 devices with Homey Cloud

View the pairing instructions
  1. Add your Shelly device to the official Shelly smartphone app;
  2. Enable cloud on the Shelly device;
  3. Update the Shelly to the latest device firmware if needed;
  4. Then pair your Shelly device in Homey Cloud. Upon pairing you will be asked to enter the credentials of your Shelly cloud account.
  5. After confirmation your Shelly device is paired and you are good to go.

Pairing instructions Bluetooth (BLU) devices with Homey Cloud

View the pairing instructions
  1. Add your Shelly BLU device to the official Shelly smartphone app;
  2. Within the Shelly smartphone app connect your BLU device with a Plus/Pro devices which is already connected to the cloud;
  3. Afterwards make sure this Plus/Pro devices:
  • Is actually connected to the Cloud
  • Has Bluetooth enabled
  • Has the Bluetooth Gateway enabled
  • (you can reboot this device to make absolutely sure these settings are maintained)
  1. Then pair your Shelly BLU device in Homey Cloud. Upon pairing you will be asked to enter the credentials of your Shelly cloud account if this is the first Shelly device you are pairing over the cloud.
  2. After confirmation your Shelly BLU device is paired and you are good to go.

Usage instructions

Using the generic action event trigger card

Read how to use the generic action event trigger card for devices with inputs.

A lot of Shelly devices are capable of notifying Homey when a specific user interaction has taken place like a short- or longpress of a switch. If you have paired a supported device and you want to use this functionality you can find the “Action Event” trigger card under the app flow cards and not under any specific Shelly device (so search for Shelly when adding the card in the flow).

When you add the card to a flow you can select which device and what action should trigger your flow. Remember that press events are only registered when an Input is configured as a button under the Input settings of the device. When configured as a Switch it can only detect on/off.


Known issues

Homey cloud connection issue (all devices stop responding on Homey Cloud)

There is a known bug in Homey Cloud which Athom does not prioritize or is unable to fix. This could result in all Shelly devices not responding anymore on Homey Cloud often with the error Could not get OAuth2Client. The workaround is to reinstall the app from the app store to force a restart of the connection between Homey Cloud and Shelly Cloud. Be sure to report this issue to Athom as well so they might eventually fix this bug. When reporting this you can mention it’s an open issue for the Shelly app known as issue #78 under the verified developer support portal. To be able to actually report the issue to Athom using a form you need to select the “Other …” option and not “App” as this is not an issue with the app but with Homey Cloud. The “App” option will divert you to the Github of the Shelly app as Athom is trying to avoid users contacting them, but this is not for me to fix.

Multichannel Zwave devices dont show correct values and toggle switches main node as well.

There is a known bug in Homey with setting multichannel Zwave association upon pairing the device. You will need to go into the Zwave parameters under the main node and first change the association of group 1 from 1.1 to 1 and save it. Then change it back to 1.1 and save it again and the issue is resolved.

Zwave devices do not update the energy capabilities

The Shelly Wave devices use command class METER V6 for energy capabilities. Initially this wasn’t supported at all by the node-homey-zwavedriver library of Athom. With help of Zwave guru caseda a custom parser was created and a fix for that library was submitted as pull request. At that point it worked on all Homeys. Until Athom decided not to implement that fix in the library but to have support for command class METER v6 built into Homey firmware instead of through that library. That broke the custom parser so I had to remove that to get it working again. But apparently Athom only implemented support for command class METER v6 into the firmware for the Homey Pro '23 firmware. You should report this to Athom.

Reset energy meter on Shelly Wave device doesnt work

There is appears to be a bug in Homey firmware where resetting the energy meter on devices with command class METER v6 doesnt work. This has been reported to Athom.

Shelly BLU buttons wont work properly without a Plus/Pro device acting as Bluetooth Proxy

Please be aware, Shelly BLU devices only work properly with Homey if you also have a Plus/Pro device connected to Homey which can serve as a Bluetooth Proxy. The Bluetooth implementation of Homey isn’t sufficient as it’s not properly implemented. Read the pairing instructions for Shelly BLU devices on how to configure a Bluetooth Proxy.

Shelly Gas and TRV can not be controlled using Homey Cloud

Thats right, this is also mentioned in the app store page. If you missed this and was looking for cloud control of these devices you are out of luck. Allterco Robotics (company behind Shelly) hasnt implemented support for the capabilities of these devices in their Shelly Cloud API yet. They also wont anytime soon as for now there is no business case for them. The best thing to do is request support for this with their support team.


Troubleshooting your setup

Users often blame the app when things are not working as expected but most of the time the issue is related to their own actions and/or configuration and by not following the instructions posted here. The steps below help you identify the most common user errors. First of all, start with rebooting Homey and your Shelly device and try again. This will solve a lot of issues already. If that didn’t work, continue with the troubleshooting steps related to your issue. Only after completing these steps and still experiencing issues you should post your question in this topic and/or send a diagnostic report from the app settings. If there are no specific details in your question / diagnostic report about the steps you have already undertaken and their result you will be redirected to these troubleshooting steps (again).

1. Homey Pro: Timeout during pairing of gen1 device / any battery operated device on the icon select screen

If it’s a mains powered device and you receive a timeout / white screen during pairing for gen1 devices, you should have read and followed the pairing instructions. Make sure you update the firmware of your device. You might need to connect your Shelly to the cloud before being able to see the latest available update. If it’s a battery operated device and you receive a timeout / white screen during pairing, you should have read and followed the pairing instructions. You need to keep the device awake by pressing a button during pairing. Read the device user manual how to wake the device (usually by single pressing a button inside a pinhole or inside the device).


2. Homey Pro: Delayed status updates for gen1 devices

If you experience delayed devices status updates for gen1 devices (or no updates for battery powered devices at all) there could be multiple causes but all of them are related to the network traffic used for communicating status updates from Shelly devices to Homey. Shelly Gen 1 devices use a networking technique called CoAP. During pairing with Homey it tries to update the Shelly device where it enables CoAP and configures the IP address of Homey to allow communication.

Make sure CoAP is (still) configured correctly. You can check this through the webinterface of the Shelly device by accessing it over it’s IP address (http://yourshellyiphere) and look under "Internet & Security > Advanced > Enable CoIoT. Make sure it is enabled and the CoIoT peer setting is configured with the correct IP address of Homey and port 5683. It should look something similar to 192.168.0.10:5683. If the IP address does not match correct it and make sure Homey uses a static IP address so it doesnt change again.


3. Homey Pro: No status updates or device is unreachable errors (EHOSTUNREACH) for gen1 and gen2 (Plus/Pro) devices

If you experience no status updates and devices appearing as offline in Homey while they are accessible through the native Shelly app or the webinterface there are issues with the network traffic between Homey and the Shelly devices. There are various things to check but in the end it could also be Homey’s own networking stack which has proven to be unstable for some users.

  1. Make sure Homey and your Shelly device are on the same local network (LAN) or any VLAN’s are configured correctly. Using VLAN’s could block the network traffic between devices and Homey.
  2. Make sure your network configuration allows unicast broadcasts which is needed for CoAP traffic. Default network configurations should allow this. Older Shelly firmare versions (< 1.10.x) only allowed multicast broadcast which could give issues on even default configuration but if you followed the previous instructions you have upgraded the firmware of your Shelly device already.
  3. Make sure you assign static IP addresses for your Shelly devices and Homey in your router. Check if the IP address of your Shelly still corresponds with the IP address under the device settings in Homey. Also make sure you can access the webinterface of your Shelly devices under that IP address (http://yourshellyip/).
  4. If you followed all previous steps but still experience delays or no communication check the error message under the device. If it’s something like EHOSTUNREACH or device not reachable Homey still cant reach your device. Make sure your WiFi signal of both Homey and your Shellies is stable. Things to check is that your WiFi channel is not set to auto but to a specific channel, for instance 1,6 or 11. You can try and test the network traffic between Homey and your Shelly device with the following flow where you replace the IP address of your Shelly device in the condition card. Devices being unreachable is often a temporary state but if this flow fails consistently you are 100% sure there are still networking issues.
  5. If none of the above steps solved your issues and your WiFi is stable chances are it’s Homey’s own network stack which has proven to be unstable for some users. Sometimes this can be fixed by just restarting Homey. If the issue persists or comes back after some time it could be you are out of options. This especially can be the case for users that have a lot of WiFi devices connected to Homey. You could look into reducing the number of devices to see if that helps. Feel free to send me a diagnostic report from the app settings. Based on this I can at least confirm it’s indeed network issues. Do this by restarting the app, wait until the devices show as unreachable in Homey and send the diagnostic report from the device settings. Afterwards post the crash report ID in the support topic here together with extra information about your issue, like the firmware version, app version, Homey version and Shelly devices you have connected.

4. Homey Pro: Delayed status updates for Plus/Pro devices or no updates at all for Plus/Pro battery powered devices

If you experience delayed devices status updates for Plus/Pro devices (or no updates for battery powered devices at all) it’s most likely caused by incorrect configuration of the outbound websocket. Homey opens a websocket server for Plus/Pro device and during pairing configures the Shelly Plus/Pro device to report status updates to this websocket server. Sometimes this configuration fails or is incorrect (for instance when Homey is not assigned a static IP address) causing status updates to fallback on the slower polling method. To fix this:

  1. Open the webinterface of your Shelly by entering it’s IP address in the browser.
  2. Go to Settings > Outbound websocket.
  3. Make sure the option is enabled and pointing to your Homey IP with port 6113. The address should look similar to ws://192.168.0.2:6113/ but with the IP address of your Homey. For connection type it should be set to TLS no validation.
  4. If this configuration is missing either re-pair the device or add it manually using these instructions.

5. Homey Pro: Inconsistent Bluetooth device status updates

Please be aware, Shelly BLU devices only work properly with Homey if you also have a Plus/Pro device connected to Homey which can serve as a Bluetooth Proxy. The Bluetooth implementation of Homey isn’t sufficient. If you havent enabled a Bluetooth Proxy on any Plus/Pro devices yet first look at the pairing instructions for Bluetooth devices somewhere above here which you didnt follow. If you did enable a Bluetooth Proxy but are still seeing inconsistent status updates for Bluetooth devices (for instance a BLU DW sensor only registering the open alarm and not the close alarm), even after rebooting the Plus/Pro device, check the following.

  1. Make sure Bluetooth is enabled on the Plus/Pro device which is acting as the Bluetooth Proxy. If not, enable it from the Web UI of the Plus/Pro device and restart that Plus/Pro device.
  2. Make sure the Homey BLE Proxy script (menu item scripts under the Web UI of the Plus/Pro device) is added (visible under scripts), auto starts (switch in scripts list) and is running (pause icon in front of script - script that are not running can be started by clicking on it and pressing the start button) on the Plus/Pro device. If the script is not there, go into the Plus/Pro device advanced settings within Homey and first remove and afterwards add the BLE Proxy script again. Then check again if the script is running.
  3. Make sure the outbound websocket is configured correctly on the Plus/Pro device acting as Bluetooth Proxy. You can follow the steps as described under the troubleshoot guide Homey Pro: Delayed status updates for Plus/Pro devices or no updates at all for battery powered devices.

If it still isnt working after these steps, and you have some technical skills, you can check if the script is actually receiving the BLE advertisement events. If not, it could be a range issue where you need to place the BLU device closer to the Plus/Pro device acting as Bluetooth Proxy. You can do this by first enabling websocket debug in the Web UI of the Plus/Pro (it’s under settings > debug). Then head over to the Homey BLE Proxy script and add the following code console.log(BTHparsed); above the line with Shelly.emitEvent('NotifyBluetoothStatus', BTHparsed); around line 132. Now you can see which events the Plus/Pro device is actually receiving and proxying to Homey. If events are missing it’s a range issue, if you see the events but they are not reflected in Homey, please post the details of your setup, the output of the console and a description of what you are seeing in Homey here in this support thread.


6. Homey Pro & Cloud: Deprecation warning: "This device might not be supported in the future"

No worries, your devices will continu to function normally within Homey. But this specific driver has been replaced by a generic driver supporting al Shelly devices. You are encouraged to re-pair this device using this generic driver to make sure you do not miss out on possible new features. You will need to fix your flows after re-pairing the device.


7. Homey Cloud: No status updates for all Shelly devices

The connection between Homey Cloud and Shelly Cloud has been interrupted. Due to a bug in Homey Cloud the connection is not restored automatically. You will need to restart the app to initialize a new connection. As Homey Cloud does not allow you to restart apps the workaround for that is to reinstall the app from the app store. Be sure to report this issue to Athom as well so they will eventually fix this bug. To be able to actually report the issue to Athom using a form you need to select the “Other …” option and not “App” as this is not an issue with the app but with Homey Cloud. The “App” option will divert you to the Github of the Shelly app but this is not for me to fix.


13 Likes

Changelog

The changelog is now available on the app page in the Homey store.

v1.1.0 - 2018-09-09

  • NEW: add support for the Shelly 2
  • REFACTORING: switched from request node module to node-fetch (reduced footprint from 7,5MB to 400 kB)

did order some units today, are you happy with the unit?

I only have one Shelly 1. I had some issue with connectivity at first but after fiddling around with it it’s now working very well. Only thing I really changed was disconnect the unit from the cloud. Not really needed anyway since I can control it using Homey. Other than that it all looks good hardware and software wise.

do i just need you app? no settings in unit?

You will need the Shelly smartphone app to setup the device (like configure the WiFi etc.). After that you should not really need it anymore. Controlling the device can be done through Homey.

Hello!

I buy a pair of shelly 1 and 2. The 1 works perfectly with homey, but the shelly 2 don’t work as a roller shutter. I push the button of relay 1 and relay 2 and nothing happens. With shelly android app they work perfect. I do anything wrong?

Captura

No, currently only relay mode is supported. I’d have to find out how to dynamically change the capabilities when it’s switched to roller shutter mode.

2 Likes

Thanks for fast reply!

Are you working on this? Need some donation for buy shelly 2?

If shelly 2 works fine for roller shutter is an excellent option in price, 20€ and not 50€ of fibaro and qubino roller shutters.

I worked on it this morning. It’s a bit of guessing without the actual device but I just pushed a new release to Github. Do you know how to do a command line install so you can test this?

If so, please be specific in your findings so I can try improve the support.

1 Like

Hi @Phuturist

I install your new version 1.2.0 and nothing changes.

if helps, in homey (preview) android app, i get this error when i click on relay buttons:

Something went wrong adressing device (name of device) (invalid_capability)

Shelly 2 is more complex than shelly 1, it have several options to configure:

I appreciate your work a lot. If you need more information I will help you as much as I can. Thank you!

You will need to repair the device as a “Shelly 2 Roller Shutter” device.

1 Like

OK!!

Re-paired as a roller shutter. Now shows 6 buttons, none of them works:

In theory shelly 2 only have 2 buttons, whit several options to work. If you need more info i give you some screenshots of the shelly app.

And every several seconds the device show as unreachable in homey, but really don’t loose comunication.

roller

I have uploaded a new release. You will need to remove and repair your Shelly 2 Roller Shutter device. Could you use the athom app run command and post any errors in the output here when pairing and controlling the device.

1 Like

App updated and devide re-paired. Now show 3 buttons and no go to unreachable.

But nothing happens when i click the buttons.

in command athom app run no info is displayed when i add the device and click the buttons:

again I thank you for all your work and help!! it seems incredible to me that without having the device you can make it work!!

Well, as you can see it’s not working yet and getting it to work without the device is not the most efficient way. But it should be possible. Don’t have a clue why it’s not working yet though, I’ll see if I can add some extra debug logging that should give me more hints on what is going on.

I have added extra debug logging in the latest version on GitHub. Could you use the CLI command athom app run, try and change the roller shutter from the device card and post the output from the console here.

1 Like

Here is the log I have in command prompt:

send command result is:
{ wifi_sta: { connected: true, ssid: ‘ubiquiti’, ip: ‘192.168.1.110’ },
cloud: { enabled: true, connected: true },
mqtt: { connected: false },
time: ‘00:00’,
serial: 37,
has_update: false,
mac: ‘827D3A5B270D’,
relays:
[ { ison: false,
has_timer: false,
overpower: false,
is_valid: true },
{ ison: false,
has_timer: false,
overpower: false,
is_valid: true } ],
rollers:
[ { state: ‘stop’,
power: 0,
is_valid: true,
safety_switch: false,
stop_reason: ‘normal’,
last_direction: ‘close’ } ],
meters:
[ { power: 0,
is_valid: true,
timestamp: 1542067208,
counters: [Array],
total: 0 } ],
update:
{ status: ‘idle’,
has_update: false,
new_version: ‘20181031-101144/v1.3.5@62608979’,
old_version: ‘20181031-101144/v1.3.5@62608979’ },
ram_total: 50560,
ram_free: 36968,
fs_size: 233681,
fs_free: 161644,
uptime: 120782 }
[ { state: ‘stop’,
power: 0,
is_valid: true,
safety_switch: false,
stop_reason: ‘normal’,
last_direction: ‘close’ } ]
rollers[0].state is: stop

This all looks good, I fixed another bug that prevented controlling the roller shutter. Could you try downloading and running it again.