Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Raw code #14

Open
sygys opened this issue Oct 24, 2021 · 5 comments
Open

Raw code #14

sygys opened this issue Oct 24, 2021 · 5 comments

Comments

@sygys
Copy link

sygys commented Oct 24, 2021

Hi @ee02217

We spoke a while back about the integration and putting it in node red. At the moment i use node red and turn on the zb1 heater using this code with a special xiaomi node that fills in the ip and token. I was wondering if you know what the raw json code would be if i wanted to post a turn off command directly from home assistant using a rest command. I guess the token and ip need to go in the header? But how should this be formatted? Could you please help me?

So this what i post in the msg.payload but how would a rest command look if i also include the ip and token?

{
    "cmd": "miio",
    "method": "get_properties",
    "value": [
        {
            "siid": 2,
            "piid": 2
        }
    ]
}
@sygys
Copy link
Author

sygys commented Oct 24, 2021

We also spoke about the integration giving delays in home assistant when running. I havent figured it out yet but today i was thinking... Could it be that because you didnt set a "SCAN_INTERVAL =" the integration runs continuously causing home assistant to ocasionally freeze for a second? I have no idea what the scan interval is when it is not set.

@sygys
Copy link
Author

sygys commented Jan 4, 2023

Wow this is a very active github with loads of support! (sarcasm off)

I guess the problems with delays created in HA had something to do with this:

make device detection in code persistent (instead of querying device everytime).

For the last couple years i made my own little code in node red to control the heater. its always nicer to have it integrated the nice way so i looked at the repository and saw you updated something 3 months ago and i read this: "instead of querying device everytime"

After testing i think this querying was indeed the cause of HA freezing for a second every now and then. So kudos! I can now finally use this integration.

@sygys
Copy link
Author

sygys commented Jan 4, 2023

I see its still not fixed. Once per minute there is a freeze now. YOu can easily reproduce this by opening a camera stream in HA and watch it. you will see the video freeze for about 4 seconds every minute. when removing the mii heater integration fixes these freezes. Something in this integration creates a tremendous lag in HA. even on my NUC i7 10th gen. Its a shame because i love the idea of having a climate entity for this heater. but this integration is broken somewhere.

I also have A CPU load entity that refreshes 1 per second. i can see this entity also not updating in this 4 second freeze. So whole home assistant freezes for about 4 seconds every minute with this integration. lights wont react, automations wont run...

There is seriously something wrong with this integration. Its like its polling every minute or tries to make a connection every minute and lets whole HA freeze until it gets a respond. The logs show no errors though.

@ee02217
Copy link
Owner

ee02217 commented Jan 4, 2023

I would love to receive help in the form of a merge request :)
As I mentioned before, I am not a developer or expert coder… there are lots of improvements I would like to do, but simply don’t know how…
Been wishing for 2 years that this was just a temporary workaround until someone integrated it natively in HA.

@sygys
Copy link
Author

sygys commented Jan 5, 2023

I have the same problem. i dont know how to do this either. I dont have enough time to learn all this either. there are so much things to learn thats its impossible to do it all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants