Shellyforhass: No errors in log, but not working for me

Created on 20 Aug 2019  Â·  83Comments  Â·  Source: StyraHem/ShellyForHASS

Hi

I've installed via HACS and I'm on version 0.0.15
My config is

shelly:
  discovery: true
  version: true
  show_id_in_name: true
  additional_information: true
  power_decimals: 2
  sensors: 
    - power
    - rssi
    - uptime
    - over_power
    - device_temp
    - over_temp
    - cloud
    - mqtt
    - battery

I don’t see them in MQTT integrations and I don't see any of the sensors requested (rssi, mqtt, cloud and so on).
I’ve also tried to use the - all option instead of defining one by one.

I’ve also defined in the log

logger:
  default: error
  logs:
    custom_components.shelly: debug

but I don’t see any error.

In the log I see

2019-08-20 11:57:35 INFO (SyncWorker_5) [custom_components.shelly] Starting shelly, 0.0.15
2019-08-20 11:57:35 INFO (SyncWorker_5) [custom_components.shelly] pyShelly, 0.0.31

What can I check?

Thanks

fixed

Most helpful comment

Working with a version that can work without CoAP also, it will do polling and allow to add devices by ip.

All 83 comments

Thanks,

You can see the switches?
When you click on a switch can you see the attributes like rssi for that device?

You can try to add pyShelly for debug logging:

logger:
  default: error
  logs:
      pyShelly: debug

Thank @hakana

I remember I've installed and removed a few time later when first was created.

I don't think I can see the switches that ShellyforHass should create.

This is what I see in the MQTT Integrations panel

Schermata 2019-08-20 alle 14 22 59

But the fw I see here is not the real fw of my Shelly 1 that is 1.5.0-hotfix4

Consider that I have already created manually covers and switches using the mqtt like this example

cover: 
  - platform: mqtt
    name: "Tenda sala"
    command_topic: "shellies/shellyswitch-xxxxxx/roller/0/command"
    position_topic: "shellies/shellyswitch-xxxxxx/roller/0/pos"
    set_position_topic: "shellies/shellyswitch-xxxxxx/roller/0/command/pos"
    availability_topic: 'shellies/shellyswitch-xxxxxx/online'
    unique_id: 'Shelly Tenda sala'
    qos: 0
    retain: false
    payload_open: "close"
    payload_close: "open"
    payload_stop: "stop"
    payload_available: 'true'
    payload_not_available: 'false'
    position_open: 0
    position_closed: 100
    optimistic: false

switch: 
  - platform: mqtt
    name: "Shelly1_1"
    state_topic: "shellies/shelly1-yyyyyy/relay/0"
    command_topic: "shellies/shelly1-yyyyyy/relay/0/command"
    payload_on: "on"
    payload_off: "off"
    state_on: "on"
    state_off: "off"
    optimistic: false
    qos: 0
    retain: false

After adding in the logger what you've suggested I see

2019-08-20 14:16:38 INFO (SyncWorker_8) [custom_components.shelly] Starting shelly, 0.0.15
2019-08-20 14:16:38 INFO (SyncWorker_8) [pyShelly] Init pyShelly 0.0.31
2019-08-20 14:16:38 INFO (SyncWorker_8) [custom_components.shelly] pyShelly, 0.0.31

ShellyForHASS have nothing to do with MQTT. ShellyForHASS use CoAP for discovering devices, that is multicasts over UDP port 5683. If you run this python script in your teminal you can see if it receive the CoAP messages.

https://github.com/StyraHem/ShellyForHASS/blob/master/util/test.py

Should I change anything (IP Address) in the test.py ?

If I don't change I get no response and it stuck.

If I put a local IP address of one of my shelly 1 I get this error

Traceback (most recent call last):
  File "test.py", line 11, in <module>
    sock.setsockopt(socket.IPPROTO_IP, socket.IP_ADD_MEMBERSHIP, mreq)
OSError: [Errno 22] Invalid argument

In the Shelly configuration COAP is not selected, otherwise I cannot select MQTT

Schermata 2019-08-20 alle 14 50 57

No you should not change any thing in script. That it not return any CoAP messages mean something in between the Shelly and HA stop them. It could be the router or the fire wall in your HA machine. Sometime it helps to turn in IGMP in your router if there is a setting for that. Some times you need to enable Multicasts in HA machine. I can't help you more than that.

The plugin does not require you turn on "Enable action execution via CoAP protocol)

Ok, thanks for your explanation

I have Hassio installed on an Intel NUC with Proxmox as Virtualizer, Ubuntu Server in the VM and Hassio installed in Docker.
Maybe something related to this is the cause, but everything else I have installed in Hassio, plugins and other is working fine.
I have Nodered, MotionEye and other stuff as plugin.

Really don't know where to look at, but I am really sad I couldn't use this component!

I'm using Portainer as Docker manager.

Maybe someone who is more expert than me can help on how to solve this...

Can you connect a standard computer with Pyton to the network, and run the test.py? If that work you know the router are ok. You can try both connect to WiFi and LAN and see if any difference.

I search on google on multicast and Proxmox maybe you can find any thing there.
https://www.google.com/search?q=Proxmox+ubunto+multicast

just tested test.py on an LinuxMint installation on a laptop, with no virtualization.

Same stuff, no messages.

My modem/router is a Fritz 7590 and I am connected directly to it via cable.

So there is something elsewhere....
Really odd!

AFAIK Fritz 7590 supports multicast

Schermata 2019-08-20 alle 15 51 20

Have you looked on the settings in the router? Because you not receive the messages in laptop the problem must be in the router. Look for igmp settings abd try to do some changes.

There are no IGMP particular settings in my router.
Should I open any particular port ?

Is it possible to use another port instead of the 5683 ?

It seems that this port is already in use (but I can't imagine which application is using it, maybe is the ShellyforHass plugin)

netstat -ln | grep 5683
gives

udp 0 0 0.0.0.0:5683 0.0.0.0:*

while on 5682, for example, return nothing

Now I've asked in a local Fritz forum to have some more information regarding Multicast / IGMP.

Hope to have some news

Some news.

I downloaded a Windows tool called Multicast Tester which has a transmitter and a Receiver part.

If I set the Trasmitter to 224.0.1.187 port 5683 and launch the test.py I get the messages sent

So Multicast should work, isn't it?

It seems that the problem is the "transmitter" part that is not transmitting, maybe.

Are you testing this between different computers? Also test to connect the transmitter by WiFi.

The transmitter is on a laptop via cable and the test.py is directly on the Hassio server via cable.

I have tried also on the laptop connected via Wifi and Hassio via cable and it's working

That is very strange... Can you post a message on the Shelly support and see if they can help you. You can also test to upgrade to latest fw 1.5.1 and see if that helps.

https://www.facebook.com/groups/ShellyIoTCommunitySupport/

Ok, I'll try

Just to understand it better, all the Shellies send COAP messages to 224.0.1.187 port 5683 , is it correct?

Yes!

Sorry, I haven't removed the last sentence from the previous message

I have left the test.py active and now I see two identical messages

b'P\x01\x00\n\xb3cit\x01d\xff'
b'P\x01\x00\n\xb3cit\x01d\xff'

Don't know what they mean and where do they come from...

That is sent from the Shelly plugin in HASS

Today I downloaded a Windows tool for Shelly, ShellyAdmin, that uses COAP to communicate with Shellies and report all the Shellies in the lan.

Schermata 2019-08-21 alle 11 11 45

And this is what I get fro test.py

b'P\x01\x82*\xb3cit\x01d'
b'P\x01\xc6k<192.168.1.84\x83cit\x01d'


Are you running Shelly.Admin and test.py on the same computer?

Nope.
Shelly admin on the Windows laptop and test.py on the Hassio server with Proxmox
But this morning I tried also with an Hassio fresh install on a Rpi3 with docker.
Same result.

Do you have the possibility to run the test.py on the window laptop?

I don't have python installed.
I will try tomorrow afternoon.

Just tested on same laptop, ShellyAdmin and test.py

same result as if they are on separate computer

b'P\x01\x7f\xaf\xb3cit\x01d'
b'P\x01\xc3\xf1<192.168.xxx.xxx\x83cit\x01d'

Hi all, I have some problem of Woody4165.
This is my config:
Vodafone station revolution with firmware 5.4.8.1.327.1.51
HassOS version 2.12 on Raspberry Pi
different shelly devices with firmware v1.5.2 or 1.5.3
shelly: in my configuration.yaml file
on hassio I have Mosquitto Broker and all devices are connected to Hassio with MQTT protocol.
My problem is:
with version 0.0.15 I see shelly devices but all are offline or "non disponibile"
with version 0.0.18 I don't see any shelly devices.
any idea?

Is it possible for me to login by ssh on any of your systems or remote access with some other system? I can't reproduce this my self.

can I contact you via PM?

@woody4165 Yes

yes

You can email me hakan(at)tarra.se

hi there. i also have the same problem...

how can i run the py file?

image

but with the tool shelly.admin it detects all my devices

image

Hi Guys. I have same problem.

Any one that can help giving me access to there system? I can't reproduce this and I have tried a lot. I installed HassIO, Raspian etc but it working for me ;(

yes i can give acess. teamviewer?

@mclaudiopt Yes that will help! What chat are you using?

Well i had the same issue. didn't think it was working.
no errors
But now i get it!
its because i had an expectation that HA would announce it discovered new devices just like it does with MQTT or ESPHOME.
nope not true
its not till i looked in unused entities that i saw my shelly 2 switch was there hiding away with all the sensors.
still undecided if i will keep the Shelly FW or ESPhome it like a have done with all my other shellies

I think you can see the same unused entities in Developer Tools->States if you know the name or part of the name, but clicking the Unused Entities menu you can see all together.

I don't see them anyway in the Unused Entities menu...

@hakana discord or teamviewer or skype...any one :-)
today after 6pm its ok for you? PM to exchange acess

@hakana meanwhile this is the log

2019-08-26 13:14:23 DEBUG (Thread-2) [pyShelly] IGMP fix
2019-08-26 13:15:23 DEBUG (Thread-2) [pyShelly] IGMP fix
2019-08-26 13:16:23 DEBUG (Thread-2) [pyShelly] IGMP fix
2019-08-26 13:17:23 DEBUG (Thread-2) [pyShelly] IGMP fix
2019-08-26 13:18:23 DEBUG (Thread-2) [pyShelly] IGMP fix
2019-08-26 13:19:23 DEBUG (Thread-2) [pyShelly] IGMP fix
2019-08-26 13:20:23 DEBUG (Thread-2) [pyShelly] IGMP fix
2019-08-26 13:21:23 DEBUG (Thread-2) [pyShelly] IGMP fix

@hakana if you need I will be available to TeamViewer connection. Let me know if you need it

Hi all,
I reinstall HASSIO and all component. This is my home-assistant.log file:
2019-08-26 19:41:25 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for shelly which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant.
2019-08-26 19:41:25 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant.
2019-08-26 19:42:00 INFO (SyncWorker_10) [pyShelly] Init pyShelly 0.0.34
have you got some news?

No, it is very strange. I have done lots of installations and for me it work every time ;(

Hi @hakana

I've just completed a clean install of Hassio (the image downloaded) on a RPI3 and added HACS and then this component. I've placed just shelly: in configuration.yaml

I've left turned on all night, but I don't find any shelly entity.

Since there are some people having the issue and the most does not have, maybe there is something in common that prevent the COAP communication.

Router?
Network type?
Repeater?

I have a Fritz 7590 where Hassio (test on RPi3 and production on Intel NUC) are connected via cable.

I have an OpenWRT Access Point where all the Shellies are connected.

Thanks

Dear woody4165, with witch version of ShellyForHASS do you working? I have identical problem about you. My configuration is:

  • Vodafone Station like router and wifi access point.
  • hassio on RPi connected by LAN
  • "shelly:" in configuration.yaml
  • Mosquitto MQTT
  • aeotec USB key for z-wave network

I try a new last Hassio version in a second Rpi only with ShellyForHASS. Until version 0.0.14 I see shelly devices but offline. If I upgrade to new version I don't see any shelly devices.
Claudio

Mine is

  • Fritz 7590 as mode / router. Chinese Access Point with Openwrt
  • Hassio in Docker on Ubuntu Server 18.04 LTS on a Proxmox virtual machine
  • shelly: in configuration.yaml
  • MQTT Hassio addon (shelly are defined also as MQTT entities)
  • Conbee Zigbee stick
  • ShellyForHass is 0.0.19 and Hassio 0.97.2

As hardware an Intel NUC i3

My friends I have good news: I install home assistant on Rasbian and, first of all ShellyForHASS from HACS: It works correctly with all of my shelly devices!!!! then I install Mosquitto MQTT broker and another add on and all works correctly. now, my question is: the problem could be Hassio?

I don't think so since the test.py script to check COAP message does not work on Hassio machine as well on a standard Linux machine.
At least for me.

It working on for most people. But some having this problem. Im not a Linux /network expert. I think the problem is in the router and maybe not support IGMPv2 or simular.

Hi @hakana
Today I will try to connect an Rpi3 with Hassio and a Shelly to a Mikrotik router, wired the first and wireless the second.
And I will let you know if there is any news...

Great, look forward to get your result.

Just tried with a Mikrotik Access Point, HAP Lite, and magically it works.
So, as you said, the problem is from my main router side (Fritz 7590) that does not manage properly the IGMP.
I have tried with a fresh&clean Hassio install on an RPi3, but probably will work also on my virtualized environment.
Now the question is if I want to put the Mikrotik as main or slave router and connect to it the Hassio server and all the Shellies, which implies, most probably, to have two subnets, one from the main modem/router and one from the Mikrotik.
The Wifi signal of this Mikrotik device is very poor compared to the Fritz and to the Chinese AP that I already have.
So I have to understand the best way to do it.

In any case, I have to thank @hakana for the time spent trying to help me and other people that have also different router than my Fritz and does not support correctly IGMP/COAP communication!
I hope I can use someday this Custom Component that is very well done.

Thanks again!

Good news to know, but...
My system was working very well, but suddenly all shelly stop to be recognized.

Nothing was changed. My router, switched and ap remain the same.

bad news from me: I install last version of hassio (not home hassistant) and I see only sensor.shelly version. I dont' see shelly components.

Hi @hakana
I would like to try one more thing.
Since I'm pretty sure that this was working some time ago (I still have the sensor _shsw_ defined in HA), I would like to try some old versions, older than the one I can see in HACS.

Is it possible?

Thanks

What ever versions are on github you can install. You don't need HACS to do it. HACS just makes it easier to install and keep update

Sent from my Samsung Galaxy smartphone.

-------- Original message --------
From: woody4165 notifications@github.com
Date: 1/9/19 7:22 pm (GMT+10:00)
To: StyraHem/ShellyForHASS ShellyForHASS@noreply.github.com
Cc: George Georgas george@cnscomputers.com.au, Comment comment@noreply.github.com
Subject: Re: [StyraHem/ShellyForHASS] No errors in log, but not working for me (#52)

Hi @hakanahttps://github.com/hakana
I would like to try one more thing.
Since I'm pretty sure that this was working some time ago (I still have the sensor shsw defined in HA), I would like to try some old versions, older than the one I can see in HACS.

Is it possible?

Thanks

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHubhttps://github.com/StyraHem/ShellyForHASS/issues/52?email_source=notifications&email_token=AMNWOQNNMHNL63LLJITI27DQHOCWRA5CNFSM4INTZDLKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5T6HMQ#issuecomment-526902194, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AMNWOQLEFHL4DICBZOHXCLTQHOCWRANCNFSM4INTZDLA.

Yes all code is in GitHub, there is only releases created for the last releases but you can find the code there.

I've installed 0.0.8 and now I remember why I have uninstalled first time.
Now I can see all the sensors, but they turn from unknown to unavailable to the real state.

Probably the cause is the issue with IGMP and my modem/router, but with that version at least the communication was kind of working...
Don't know until what version is "working", but in any case was not usable.

This just to let you know the reason why I uninstalled the first time.

We working on this issue together with the Shelly team

Hi Hakana.
A couples of days ago, I have noted one thing. After a router rebooting my shelly start to work again just for a couples of minutes.

Try igmp_fix: true and see if that helps

I've tried but no changes!

This version 0.1.0 does not work for me.

We working on this issue together with the Shelly team

any updates from the Shelly team?
I've just added igmp_fix: true and will check if this will help.

Having the same problem, i can get remote acces hakana. intemo eg200 router

@SuperCocov9 try steps described here: https://github.com/StyraHem/ShellyForHASS/issues/69#issuecomment-548322267
check ping, add igmp_fix: true and increase unavailable_after_sec it helped in my case.

@Misiu now i am getting this xD
Error fetching data: http://192.168.1.221/ failed with HTTPConnectionPool(host='192.168.1.221', port=80): Max retries exceeded with url: / (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 113] Host is unreachable'))
Conexión perdida. Reconectando...

@SuperCocov9 add ping sensor:

binary_sensor:
  - platform: ping
    host: 192.168.1.221
    name: Shelly
    scan_interval: 30

it looks like HA can't make a request to Shelly.
Check what IP does the Shelly device has, You can do that in Shelly app.
Also, set a static IP for the device, this might help.

@Misiu nevermid, that error was a crapy sensor i wrote for a shelly ht, still cant get shellyforhass working in any way, my cover and a switch appears as "not available", just that.

@SuperCocov9 I had the exact same problem. Are Shelly devices always "not available"? add unavailable_after_sec to configuration.yaml and set its value to 180 (the default is 60)

@misiu did it, rebooted, even the router, dame result...

@SuperCocov9 sorry, can't do more. I'm still new to HA and Python. I just described the steps that helped in my case.
It looks that we must wait for the next version of this integration.
Hopefully, someday we will be able to use MQTT and Shelly cloud together. Write to Shelly's support about that (I did). Maybe if they get a lot of requests they'll implement this feature :)

Hi,

I have the same issue as other users above.

  • test.py in homeassistant docker image: no go
  • ShellyAdmin.exe (v1.0.0.28) on the laptop, perefctly detects the Shelly.

Is there a way to add Shelly based on IP instead than discover them ?

Thank you,

Simone

Hi,

I have the same issue as other users above.

* test.py in homeassistant docker image: no go

* ShellyAdmin.exe (v1.0.0.28) on the laptop, perefctly detects the Shelly.

Is there a way to add Shelly based on IP instead than discover them ?

Thank you,

Simone

Ciao simone, are you in Italy and are you working woth Vodafone Station? I do and I have your some problem. I think that problem colud be Vodafone Station.
Claudio

Ciao simone, are you in Italy and are you working woth Vodafone Station? I do and I have your some problem. I think that problem colud be Vodafone Station.
Claudio

Hi Claudio, yes I'm italian and I have the Vodafone Station.
On my wndows laptop, multicast works like a charm so it should not be a network problem.
The issue is more related to docker that seems to not allow multicast.
I'm investigating.

Try the following exe, http://uniqhost.de/ShellyAdmin/setup.exe, and report back if it works for you.

Ciao,

Simone

The issue is more related to docker that seems to not allow multicast.
I'm investigating.

Seems more related to the NAS Synology itself. If i ssh on it and run the test, nothing happens.

Simone

Working with a version that can work without CoAP also, it will do polling and allow to add devices by ip.

Working for me since 0.1.3b1.

@woody4165 is that true also for you ? If so can you please close the issue ?

Simone

Hi all, just to inform that after 3 weeks of inactivities on very old thread, I'll proceed to close them.
If later one someone verify that the issue is still there, a new issue need to be opened.

Thank you,

Simone

No update for 21 days, closing

Simone

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dodg3r picture dodg3r  Â·  12Comments

balloob picture balloob  Â·  3Comments

n3tkiller picture n3tkiller  Â·  7Comments

vistalba picture vistalba  Â·  9Comments

filmgarage picture filmgarage  Â·  7Comments