Closed LIrahara closed 8 months ago
Hi @LIrahara I did not get you.
Could you please explain better, maybe attaching some screenshots of what you have on switchbot and what you would have in HomeAssistant, or what you already have.
Thanks
Yeah sure,
So in the first screen shot, it shows the buttons for control that have been automatically populated by switch bot on positive identification of the AC unit. I noted that these buttons have varying names and assumed that it would need to be added exactly in supported functions, which is what I did. The following 2 screen shots show where I am adding the buttons into home assistant. Once added into HA, and assigned to a button, they don't perform as expected. The unit does not turn off and turn on from HA. The AC unit does respond like it has accepted a command but it's like its a command for increasing the temp for example. It just double beeps and carries on running. When sending the off command I would expect a long beep and for it to stop running. It seems something is being lost in translation here. I might be doing something wrong.
Your guide indicates support for custom buttons. Is that the only way to achieve what I'm talking about or should I be able to do it with the pre populated ones as described above.
Hope that makes a bit more sense.
Hi @LIrahara
Now it's clearest.
You should see your switchbot devices under the integration page under the configured hub.
So I'm doing everything right?
The functions are not working if I do it this way.
Do I need to make custom buttons repeating the functions? Like do I need to make my own ON button for this to work?
I don't know.
Do you see your configured device in the HA devices list?
Can you publish your HA screens?
Also logs would be helpful
Apologies Kira,
Have been out of the country. Ill be home in a few days and will tackle this. Its difficult if im not testing locally.
Hi Kira,
Okay so I did a bit of work today. I have a bunch of new hubs, so I just started from scratch. By the way, is there a way to clear hubs that are no longer used in the integration? I tried to delete and Reinstall but couldn't.
Anyways, So I added a hub, and set up the ac control. It works from the switchbot app interface as well as the prepopulated control interface on home assistant. So that's all happy days.
The issue comes in when trying to add the individual button as an entity in he assistant. Following what I put up previously, 1) Go to the switchbot app and note the name of the button which is case sensitive.
2) Go to Home Assistant and go into the configuration of the AC control and add it into the button names
3) Go into the new entity in Home Assistant and trigger it. Note the timestamp here. The ac does respond to a received command but it's not the off command and the unit keeps running.
4) On checking the logs in the Switchbot app, it is confirmed that the Off command was not sent but rather a temp change and fan change and a few other ones. You can see this timestamp lines up with the one in Home Assistant.
5) Knowing I can get a successful Off response from the ac unit using the control in the switch bot app, I went back and hit that button. AC turned off with no issue.
6) The logs in the Switchbot app reflect the turn off command. This is obviously different from what was sent in the steps above, but just done as a confirmation.
7) So looking at the logs, they hold case sensitive commands, which lines up with what your guide says and the newly noted "Turn off" in the log led me to believe that what's on the button may be incorrect so I went back and added another button in the Home Assistant config reflecting this.
8) Tried hitting this new entity and again the correct command was not received by the ac unit.
9) You can see this reflected in the Switchbot logs.
Unsure what I'm doing wrong here. I feel like it might be something simple though.
Can you attach logs?
You can't remove hub from the integration you had to unlink them from your switchbot account.
Sorry, new to the home assistant scene.
I've enabled logging and debugging for the integration and filtered for the created "off" button shown in the screenshot below.
Is that what you need or are you chasing something else? I just found a log file in my phone also. That might be what you're chasing. Logging was not enabled for the tests I outlined in the previous post.
I analyzed the logs and it seems there is no issue when request is sending to the switchbot systems.
2024-03-08 21:34:00.951 DEBUG (SyncWorker_2) [custom_components.switchbotremote.client.remote] Sending command setAll
2024-03-08 21:34:00.952 DEBUG (SyncWorker_2) [custom_components.switchbotremote.client.remote] Command payload {'commandType': 'command', 'command': 'setAll', 'parameter': '28,2,1,on'}
2024-03-08 21:34:00.952 DEBUG (SyncWorker_2) [custom_components.switchbotremote.client.client] Calling service https://api.switch-bot.com/v1.1/devices/01-202403081452-14540302/commands
2024-03-08 21:34:02.190 DEBUG (SyncWorker_2) [custom_components.switchbotremote.client.client] Call service https://api.switch-bot.com/v1.1/devices/01-202403081452-14540302/commands OK
2024-03-08 21:34:06.531 DEBUG (SyncWorker_62) [custom_components.switchbotremote.client.remote] Sending command setAll
2024-03-08 21:34:06.531 DEBUG (SyncWorker_62) [custom_components.switchbotremote.client.remote] Command payload {'commandType': 'command', 'command': 'setAll', 'parameter': '19.0,2,1,on'}
2024-03-08 21:34:06.532 DEBUG (SyncWorker_62) [custom_components.switchbotremote.client.client] Calling service https://api.switch-bot.com/v1.1/devices/01-202403081452-14540302/commands
2024-03-08 21:34:07.713 DEBUG (SyncWorker_62) [custom_components.switchbotremote.client.client] Call service https://api.switch-bot.com/v1.1/devices/01-202403081452-14540302/commands OK
2024-03-08 21:35:02.526 DEBUG (SyncWorker_29) [custom_components.switchbotremote.client.remote] Sending command OFF
2024-03-08 21:35:02.527 DEBUG (SyncWorker_29) [custom_components.switchbotremote.client.remote] Command payload {'commandType': 'customize', 'command': 'OFF', 'parameter': 'default'}
2024-03-08 21:35:02.527 DEBUG (SyncWorker_29) [custom_components.switchbotremote.client.client] Calling service https://api.switch-bot.com/v1.1/devices/01-202403081452-14540302/commands
2024-03-08 21:35:03.925 DEBUG (SyncWorker_29) [custom_components.switchbotremote.client.client] Call service https://api.switch-bot.com/v1.1/devices/01-202403081452-14540302/commands OK
Also you confirm that from the switchbot app you can see the request sent by the integration. So I cannot help you more than this.
I'm sorry
Hi Kira,
This isn't much of an issue but more of a question. I'm having trouble getting the control functions for my AC to show up as usable entities in home assistant. Can this only be done through custom buttons, or is there a way to get the pre populated buttons to work?
I followed the naming conventions in the guide and they did show up in home assistant, but don't seem to be doing what they say. On and off just cause a beep like a command has been sent through but it doesn't switch off or anything.
Is there a guide for this anywhere?
Cheers