StyraHem / ShellyForHASS

Shelly smart home platform for Home Assistant
MIT License
620 stars 111 forks source link

[BUG] Sensor not triggered after migration to db-configuration #538

Closed emufan closed 2 years ago

emufan commented 3 years ago

Environment

Describe the bug

Shelly 1 sensor is not triggered if I change/migrate from simple yaml-configuration to database setup

Recently I migrated (as offered) from yaml-configuration to database and deleted the yaml entries.

These were more than simple, only

shelly: username: admin password: adminpw

And installed is currently only one Shelly 1 (doorbell sensor).

Before this migration, every doorbell press was send to HA. After the "migration", it is only by chance. Let's say 5 from 10 presses are send to HA or receiver by HA.

This was the case already with FW before 1.10 and is now with 1.10. It is the case with mcast and as well with unicast.

Then I deleted the integration, put the line back in yaml and restarted. Now I'm back in yaml-mode and again every press (100%) was sent.

I did this two times, migrated again, max 50%, deleted again, witched back to yaml, 100%.

Expected behavior

DB-setup should work as yaml mode.

So what is set in db-mode automatically, what is not set via defaults, if I only use yaml

shelly: username: admin password: adminpw

and makes the problem?

Traceback/Error logs

No error log. It is only just not working the same way.

hakana commented 3 years ago

Have a look in the storage folder, the configuration for the integration will be there.

emufan commented 3 years ago

Thx, @hakana. Will check this. But I wonder why and what is happeing in your

image

step, that it is working before and with the three yaml lines above like a charme and afterwards not anymore. Should this migration not only migrate what is there and work afterwards still the same and without problems?

And if this migration should be improved to avoid this.

@hakana Checked now. Here the differences after click above

image

So far more than the old three line from config.yaml is taken over/added. And whatever now results in the malfunction, I don't know. It directly startet after the new try again. Ony some of the sensor presses are getting to HA. I deleted again, startet over gain with the three line above and again 100% is getting to HA again.

emufan commented 3 years ago

@hakana Really no interest in solving this issue or at least some feedback. Again, if I use the 3 line yaml config.yaml

shelly:
username: admin
password: adminpw

every button press is sent to or is received by HA. If I migrate and all the lines are added (see screenshot above), only 25% of button presses are sent to or are received by HA.

I can test this as often I want. Always the same. So some settings, which are automatically set in storage folder and in yellow part of the screenshot, makes the difference and stops the integration to work properly.

hakana commented 3 years ago

I can't see the reason that this will do the change. Did you restarted HA, can you see any errors in log?

You can try to copy the yellow rows to your config.yaml and see if it works.

emufan commented 3 years ago

Yes, restarted. No errors in the log. "Only" very limited pushes to HA compared to config-yaml lines.