sargue / learn-broadlink

Broadlink RM IR remote learning script for smartir Home Assistant integration
MIT License
14 stars 2 forks source link

issue with 0.5 degrees jumps #1

Closed Dannino-Shuli closed 1 month ago

Dannino-Shuli commented 1 month ago

HI,

thank you so much for this great great script!!! I just have 1 issue - one of my ACs has 0.5 degrees jumps. how can I solve this??? I tried to put "0.5" in the "precision" but nothing helps....

pleaseeeee advise :)

sargue commented 1 month ago

Yep, you're right. The code is currently assuming natural numbers for the temperature. You will need to change the code on learn.py to handle 0.5 increments. Perhaps the proper way would be to read the precision from the json file.

I do not plan to implement that myself. I don't need it, and I just shared this code in case it was useful for someone. If you want to give it a try and manage to make it work I would happily accept a PR.

Dannino-Shuli commented 1 month ago

Dear Sergi,

Thank you very much for the prompt reply, sir. Can you please elaborate regarding if I would want to give it a try? Is it something to open the py script and just change the text or something "deeper"? (sorry for the quotation, I'm not familiar with code AT ALL 😅) BTW - I have a set of commands that I already did manually in the HA, as learn.command script. It took me around 3 hours and it was only 20-28 degrees. I thought to take those codes and put them manually on the "smartir" table but it is very hard work then I said, I'd prefer to run the py script and do it once and for all. On the other hand, I thought maybe to use Copilot\GPT to take those codes and arrange them for me in the form of "smartir", even though I didn't record the entire states.

What do you think?

Another thing please - do you know maybe why the smartir appears as "unavailable" in the Alexa app?

Thanks and regards!

On Fri, Sep 20, 2024 at 11:30 AM Sergi Baila @.***> wrote:

Yep, you're right. The code is currently assuming natural numbers for the temperature. You will need to change the code on learn.py to handle 0.5 increments. Perhaps the proper way would be to read the precision from the json file.

I do not plan to implement that myself. I don't need it, and I just shared this code in case it was useful for someone. If you want to give it a try and manage to make it work I would happily accept a PR.

— Reply to this email directly, view it on GitHub https://github.com/sargue/learn-broadlink/issues/1#issuecomment-2363164223, or unsubscribe https://github.com/notifications/unsubscribe-auth/A6BOLKOP4UBUX6WKLTEQ5ITZXPMJFAVCNFSM6AAAAABONPXYFOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNRTGE3DIMRSGM . You are receiving this because you authored the thread.Message ID: @.***>

sargue commented 1 month ago

Can you please elaborate regarding if I would want to give it a try? Is it something to open the py script and just change the text or something "deeper"? (sorry for the quotation, I'm not familiar with code AT ALL 😅)

Well, in a nutshell, yes, it's about changing the python script. But if you have no coding knowledge at all it won't be an easy task. But it's nonetheless a perfect starting point to learn!

Using some LLM like ChatGPT to help you with that might work, but I guess you might need some basic understanding about what's happening.

No idea about Alexa, I've never used any of those assistants / smart speakers.

My suggestion would be to reach to the Home Assistant forum (https://community.home-assistant.io/). There's plenty of excellent people on there who might help or even have the solution.

Dannino-Shuli commented 1 month ago

Thank you very much sir, will do! :)

eisack00 commented 1 month ago
    min_temperature = data['minTemperature']
    max_temperature = data['maxTemperature']
    temp_range = [round(x * 0.5, 1) for x in range(int(min_temperature * 2), int((max_temperature + 0.5) * 2))]
It works with this minor amendment :> 

Haven't tested it in HA yet, but it works for learning the IR commands. 
Alternatively, you can simply double the min/max range and then halve the units in labeling after the fact. 
sargue commented 1 month ago

Thanks @eisack00 for the patch and @PhompAng for the PR.