StyraHem / ShellyForHASS

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

[BUG] Scene Level Recalled Is Always -1% From Stored Value #550

Open proxlx opened 3 years ago

proxlx commented 3 years ago

Environment

Describe the bug

The brightness level of an shelly entity in a scene will always recall as -1% to the original stored value. For example 50% stored, 49% will output when recalled. This becomes problematic when editing a scene as each time an edit is made it will decrease the values of the entities by 1%. Also if using the scene snapshot for automations as for example if a scene is recalled and snapshot 20 times during an evening this will result in 20% decrease in brightness. This was originally posted in the HA core Github by accident and acknowledged as an issue due to the way the shelly brightness is calculated 0-255 rather than 0-100% but I then got told off for being not in the Shelly For Hass Github so here I am :-)

Steps to Reproduce

Set Brightness level example 20% (Can be in HA dashboard or Shelly app) Store Scene Recall Scene Brightness Will Be 19%

Expected behavior

Screenshots

Traceback/Error logs

Additional context

david-kalbermatten commented 3 years ago

I think this issue and mine #559 should be part of a new project. Something like "Rework Color & Brightness control" because I think this implementation is not up to the current specifications anymore...

allistermaguire commented 2 years ago

I have the same issue, I have created a new issue #636 as this one has no activity.

proxlx commented 2 years ago

Thank you for re flagging this! It causes real issues for me as I use a lot of scene snapshots in my setup which then decreases the level each time the snapshot is used. It seems such an easy fix so hopefully it gets updated. As a side note it’s not just Dimmer2 but Dimmer1 and also RGBW2 intensity levels it happens on