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

What am i doing wrong? #24

Closed
labaland opened this issue May 20, 2023 · 57 comments
Closed

What am i doing wrong? #24

labaland opened this issue May 20, 2023 · 57 comments

Comments

@labaland
Copy link

Hi i cant get HA to get the "switch.switchbot_remote_<device_name>"

This is how i installed this.

I could not find this in HACS and custom repistories did not work so i downloaded the zip from here and put the "SwitchBot-API-Script-Caller" folder in Homeassistant map "config"

I think im doing wrong at this step:

# use `mkdir -p /config/pyscript/apps/` if the directory doesn't exist
cd /config/pyscript/apps/

# Create a symbolic link to the apps directory named switchbot
ln -s /config/SwitchBot-API-Script-Caller/pyscript/apps/switchbot.py switchbot.py

How do i do that in docker-compose.yaml? i have a synology nas. this is my dockercompose fpr homeassistant;

homeassistant:
container_name: home-assistant
image: homeassistant/home-assistant:latest
volumes:
- /etc/localtime:/etc/localtime:ro
- /etc/TZ:/etc/timezone:ro
- /run/dbus:/run/dbus:ro
- /volume3/docker/homeassistant:/config
- /volume3/docker/homeassistant/SwitchBot-API-Script-Caller/pyscript/apps/:/config/pyscript/apps/
environment:
- TZ=Europe/Stockholm
Please help teally want to use my ir devices in homeassistant ! :)

@SiriosDev
Copy link
Owner

this repository is not "compatible" with hacs because it is a pyscrypt, not a Python script, from hacs you have to download only the pyscript integration, and then follow the step by step guide

@SiriosDev
Copy link
Owner

SiriosDev commented May 20, 2023

the config folder is the one in which inside you find your configuration.yaml file

@labaland
Copy link
Author

labaland commented May 20, 2023

yes that is the config yes.
1
image
,2
image

,
secrets i added in Homeassistants secrets.yaml,
,3
image
,,4
image

Anything wrong you see?

And when i restart ha i get this notification:
The following integrations and platforms could not be set up:
switchbot

Thanks for answering me! :)

@SiriosDev
Copy link
Owner

I don't understand what docker has to do with it, the actions of the guides should be done starting from the folder that contains, configuration.yaml, secret.yaml, automation.yaml etc.

@SiriosDev
Copy link
Owner

wait, from now on, I ask you a question you give me an answer

@SiriosDev
Copy link
Owner

  1. Did you install the pyscript integration from hacs?

@labaland
Copy link
Author

labaland commented May 20, 2023

I don't understand what docker has to do with it, the actions of the guides should be done starting from the folder that contains, configuration.yaml, secret.yaml, automation.yaml etc.

I thought linking the files was on the server and not in ha hehe..

wait, from now on, I ask you a question you give me an answer

Yes!

  1. Did you install the pyscript integration from hacs?

Yes i did! :)

Is my folder/file setup correct?
Thank you !

i dont understand step 4.

# use mkdir -p /config/pyscript/apps/ if the directory doesn't exist
cd /config/pyscript/apps/¨

i created thjeese 2 folders "/pyscript/apps/"

# Create a symbolic link to the apps directory named switchbot
ln -s /config/SwitchBot-API-Script-Caller/pyscript/apps/switchbot.py switchbot.py

This i was guessing is outside ha? in terminal? i dont know how to do that on a synology nas. must be in docker?? :)

@SiriosDev
Copy link
Owner

Is my folder/file setup correct?

99% wrong

@SiriosDev
Copy link
Owner

SiriosDev commented May 20, 2023

back to the questions
2. did you clone the repository as written in the guide?

@labaland
Copy link
Author

labaland commented May 20, 2023

back to the questions 2) did you clone the repository as written in the guide?

i downloaded the zip file. and used the files from there

my discord username is "labaland#1503" im in ha discord too if u want to help me faster :) if u want only :)

@SiriosDev
Copy link
Owner

you have to follow the steps in the guide, not download zipper or anything else

@SiriosDev
Copy link
Owner

SiriosDev commented May 20, 2023

custom procedures have too many things to check, help is only related to guide steps, or post installation problems

@labaland
Copy link
Author

labaland commented May 20, 2023

image

putty

@SiriosDev
Copy link
Owner

SiriosDev commented May 20, 2023

just to be sure, homeassiant is your configuration folder, yes?

@labaland
Copy link
Author

labaland commented May 20, 2023

just to be sure, homeassiant is your configraztion folder, yes?

Yes it is!
Downloaded git server. Now i could use "git clone https://github.com/SiriosDev/SwitchBot-API-Script-Caller.git" :D

@SiriosDev
Copy link
Owner

perfect

@SiriosDev
Copy link
Owner

now follow the guide and in case of errors I am here

@labaland
Copy link
Author

now follow the guide and in case of errors I am here

Yes thanks! I will try now from beginning =)

@labaland
Copy link
Author

labaland commented May 20, 2023

now follow the guide and in case of errors I am here

Ok step 1 works, really not sure about step 2 see below.

added my api and key in secrets.yalm and used https://www.uuidgenerator.net/version4 to make a uuid like "867e72d6-f1b9-5g83-acb0-2b8586591bb3"

created 2 folders pyscript & apps. Insiden HA config folder like: HAconfig.../pyscript/apps/

Then i used this command "ln -s /config/SwitchBot-API-Script-Caller/pyscript/apps/switchbot.py switchbot.py" without any errors.

Rebooted ha and did not get any enteties and the deafault switchbot integration fails to run. Should i remove that one ?

STEP 2:
I dont have any config.yaml file in "HAconfig.../pyscript/..

I really dont understand step 2. Should i create a config.yaml there and add this to it?:
allow_all_imports: true
apps:
switchbot: !include /config/SwitchBot-API-Script-Caller/pyscript/switchbot.yaml

or do you mean HomeAssistant's own configuration.yaml?

sry, and sry for not very good english! :D

@SiriosDev
Copy link
Owner

Should i remove that one ?

Nope

@SiriosDev
Copy link
Owner

sry, and sry for not very good english!

neither me! I'm Italian 😅

@SiriosDev
Copy link
Owner

SiriosDev commented May 20, 2023

so, can you post screen off homeassiant and pyscript folders?

@labaland
Copy link
Author

labaland commented May 20, 2023

so, can you post screen off homeassiant and pyscript folders?

Haha i see! here it is =) pretty much the same i guess

step 1:
image

step 2:
No config file there, should i creat one and add that?
i think i got this wrong. i should not make a pyscript folder in ha config folder??? i made that one

image

step 3:
all added:
image

step 4: in putty
image

@labaland
Copy link
Author

This i dont understand:

image

under the switchbot section?? i added mine thru ui i dont have it in my configuration.yaml. i have the hub

@labaland
Copy link
Author

This is already there:
image

@SiriosDev
Copy link
Owner

This is already there: image

ignore this file

@labaland
Copy link
Author

labaland commented May 20, 2023

This is already there: image

ignore this file

Did u see pictures above? :) 21min ago

@SiriosDev
Copy link
Owner

image

in this folder☝️, you have to create a config.yaml file and paste these code.

allow_all_imports: true
apps:
 switchbot: !include /config/SwitchBot-API-Script-Caller/pyscript/switchbot.yaml

you have to have something like this:

homeassiant/
└── pyscrpt/
    ├── apps/
    └── config.yaml
other your files
configuration.yaml

you didn't have it because you didn't finish "installing" pyscript (procedure on their hacs page/repo)
I guess you haven't even "activated" pyscript yet by entering the string in confiuration.yaml (pyscript: !include pyscript/config.yaml)

@labaland
Copy link
Author

labaland commented May 21, 2023

i created config.yaml now in homeassistant/pyscript/config.yaml wwith that text.

it looks this:

homeassiant/
  └── pyscrpt/
      ├── apps/
      └── config.yaml
  └── SwitchBot-API-Script-Caller
      ├── .git
      ├── .github
      ├── pyscript
          ├── apps
          └── config.yaml
          └── switchbot.yaml
  └── configuration.yaml

added this in configuration.yaml:
"pyscript: !include pyscript/config.yaml"

rebooted and no new entities, guess i have to do the refresh thing ?

should i make a switch for each ir device or will this make me them?

BTW i have the SwitchBot Hub Mini and a bluetooth proxy esp32

this integration adds both my Curtain and self added ir devices?

@labaland
Copy link
Author

labaland commented May 21, 2023

Now i have the services in home assistant! Thank YOU so much for helping me this much! Hope it will help another noob like me too!

I got my infrared devices but not like my courtain.? The regular switchbot integration fails at ha boot now 🤔

I think i have to use SwitchBot Generic Command for that! (edit nope? i dont get a entity for it so cant use custom command?)

thanks!!! 😍

@SiriosDev
Copy link
Owner

SiriosDev commented May 21, 2023

Now i have the services in home assistant! Thank YOU so much for helping me this much! Hope it will help another noob like me too!

great!

I got my infrared devices but not like my courtain.?

I didn't understand this question 😅

The regular switchbot integration fails at ha boot now 🤔

I don't know, the official integration uses a different method of connection, so they can't affect each other


in any case, "easy" curtain management will come with the next version, until then, they will be generated as switch entities that can be used with generic command

@labaland
Copy link
Author

Okey it started after i added this integration :P
Hmm i did not get any switch for my curtain.
Ok sweet! i wait for the update then and use api calls til then =)

@labaland
Copy link
Author

labaland commented May 21, 2023

I don't know, the official integration uses a different method of connection, so they can't affect each other

Theese are the errors in the log after i added this :) :

image

image

image

@SiriosDev
Copy link
Owner

I repeat, it is not my problem, the official integration uses the Bluetooth API, my script uses the http request API. You must have modified it to something you shouldn't have

@labaland
Copy link
Author

I repeat, it is not my problem, the official integration uses the Bluetooth API, my script uses the http request API. You must have modified it to something you shouldn't have

i have not change anything. Now i deleted the 2 folders SwitchBot-API-Script-Caller & pyscript from HA config folder and restarted then i got this when ha started :
Then it works.. wierd :/
image

@SiriosDev
Copy link
Owner

This makes no sense, they are two completely different things, the only thing in common is the fiscal object

@labaland
Copy link
Author

ok :/

Now i tested to only add back the folder "SwitchBot-API-Script-Caller" and not script pyscript, and no "pyscript: !include pyscript/config.yaml" in comfiguration.yaml

Then integration fails again. so something in that folder i guess?? 😆

@labaland
Copy link
Author

This makes no sense, they are two completely different things, the only thing in common is the fiscal object

Are you using both ? :)

@SiriosDev
Copy link
Owner

ok :/

Now i tested to only add back the folder "SwitchBot-API-Script-Caller" and not script pyscript, and no "pyscript: !include pyscript/config.yaml" in comfiguration.yaml

Then integration fails again. so something in that folder i guess?? 😆

this is impossible because just the SwitchBot-API-Script-Caller folder without pyscript doesn't do anything, it's like it's not there

@labaland
Copy link
Author

labaland commented May 21, 2023

ok :/
Now i tested to only add back the folder "SwitchBot-API-Script-Caller" and not script pyscript, and no "pyscript: !include pyscript/config.yaml" in comfiguration.yaml
Then integration fails again. so something in that folder i guess?? 😆

this is impossible because just the SwitchBot-API-Script-Caller folder without pyscript doesn't do anything, it's like it's not there

okey, very wierd :P

But "pyscript" in pic above is in the error message. so must be some kind of conflict? i have no idea. i wait for update then =)

image

image

@labaland
Copy link
Author

labaland commented May 21, 2023

@SiriosDev
Found this thread now #23 (comment)
Is it a "beta" version where curtains work?
Is it possible to download it?

@SiriosDev
Copy link
Owner

yes there is but it is not yet ready, you can use it, but without in-depth programming knowledge it will not work

@labaland
Copy link
Author

okey i understand =)

@labaland
Copy link
Author

@SiriosDev
My last quiestion, & thank you for helping me so much to get this working!
It is not possible what i understand to see the state on my airconditioner/IR HVAC? so i know the service call did work? Like i can see in the switchbot app?

@SiriosDev
Copy link
Owner

@SiriosDev
My last quiestion, & thank you for helping me so much to get this working!
It is not possible what i understand to see the state on my airconditioner/IR HVAC? so i know the service call did work? Like i can see in the switchbot app?

Next version 😉

@labaland
Copy link
Author

Cant wait :D

@labaland
Copy link
Author

@SiriosDev
Hi! Is it possible that you can add "swing" to hvac/aircon service call ? :)

@SiriosDev
Copy link
Owner

Nope, unfortunately is not supported by the Switchbot API, the only way is to take advantage of a custom remote control, and the generic command

@labaland
Copy link
Author

ahh okey! Then i will use that =)

When do you think next update will be? or is it not possible to say :P

@SiriosDev
Copy link
Owner

I think around August, now I'm busy with the university.

@labaland
Copy link
Author

labaland commented Jun 20, 2023

@SiriosDev
Hi again!
Im setting up a rpi with Home assistant to a friend at my home, and it can find my switchbot courtain.
If u remember as above my ha switchbot integration failed/got errors after i installed this api caller. So must be something.
¨
If u want i can set it up on the pi also to see if the arror appears there also.

Thanks! :)

@SiriosDev
Copy link
Owner

try and let me know

@SiriosDev
Copy link
Owner

But I am still in the midst of university exams so it still takes a while for the new update

@labaland
Copy link
Author

labaland commented Jul 5, 2023

@SiriosDev The new HA update gave me back Switchbot curatin bluetooth again :P
Btw, This integration with Aircon works amazing! Never fails a single time 👍 :)

@SiriosDev
Copy link
Owner

I said it myself that the errors were not related to this script. HVAC work by no doubt, it is the only one I can physically test, in fact the first version was only generic and hvac everything else is thanks to two guys (the second of the two will be seen in the next update)

@labaland
Copy link
Author

labaland commented Nov 7, 2023

@SiriosDev Hi! again! :)
Im sad to read that this will be discontinued, But why? Can i control my Airconditioner with official integration? i dont see anything on the docs here : https://www.home-assistant.io/integrations/switchbot/

edit i found it, SwitchBot Cloud..
But still, thank you for making this

@SiriosDev
Copy link
Owner

SiriosDev commented Nov 7, 2023

As you said, on Switch bot cloud integration work, but it's not fully working, turn on/off is still in a separated entity and some modality is not "starting"

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