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

Move HS-300 to surge protector outlet icon #303

Open
roberkane212 opened this issue Mar 7, 2023 · 39 comments
Open

Move HS-300 to surge protector outlet icon #303

roberkane212 opened this issue Mar 7, 2023 · 39 comments

Comments

@roberkane212
Copy link

Current Situation

Currently all plugs show separately as individual outlets not all as one

Proposed Change

That it will show as it is a power strip instead of individual outlets

@roberkane212
Copy link
Author

I currently have homebridge-tuya installed and have no issue with that plugin showing it
IMG_1660

@ZeliardM
Copy link

@plasticrake I am looking to get some of the Kasa HS-300 power strips, but I would like for this functionality. I don't know much in the way of coding, but I did find the following information out about this:
It seems that Tuya adds multiple outlet services to the same accessory. I am not sure how to do this but would be willing to test anything that comes up.

https://github.com/iRayanKhan/homebridge-tuya/blob/main/lib/MultiOutletAccessory.js
https://github.com/iRayanKhan/homebridge-tuya/wiki/Supported-Device-Types#smart-power-strips

@roberkane212
Copy link
Author

@plasticrake what can I do to help?

@ZeliardM
Copy link

ZeliardM commented Mar 6, 2024

I was able to create this with the homebridge-meross plugin, I will take a stab at this one and see if I can create a PR.

@roberkane212
Copy link
Author

@ZeliardM let me know if I can help in anyway

@ZeliardM
Copy link

ZeliardM commented Mar 6, 2024

I’m going to have to see, I just ordered an HS300 and will see what happens when I get it. Will start working on the code now.

@ZeliardM
Copy link

I was able to get the basic premise done for this. Had to make api calls in the plugin because the built api doesn't support passing the childId as an argument, but right now I have basic functionality up and working, just need to clean it up and fix some of the status updates in HomeKit. Once I'm finished, I'll push a PR to let them merge it if they're good with it and maybe can get them to update the API to support passing the childId and that may clean it up even more.

@roberkane212
Copy link
Author

@ZeliardM thats awesome. Again let me know if there’s anything I can do

@ZeliardM
Copy link

The code has been cleaned up and the PR has been submitted. We will see what the dev says and go from there. Until then, I'm going to keep running my local copy, lol

@roberkane212
Copy link
Author

roberkane212 commented Mar 12, 2024

@ZeliardM awesome, hopefully he responds to this asap

@roberkane212
Copy link
Author

@ZeliardM I wish I knew more coding. I’d get run a local copy myself lol

@roberkane212
Copy link
Author

@ZeliardM i see you have a forked version of the plugin. Is there anyway for me to install it by chance?

@ZeliardM
Copy link

I would not as the dev hasn't tested everything and I may have made mistakes. I cannot support it like they did.

@roberkane212
Copy link
Author

@ZeliardM I have against you saying so installed your fork, however when I changed plug to power strip. It says it’s not supported. I know you can not support your version that’s much. But the power strip this the only item I use with this plugin and would really appreciate your help. If it doesn’t work as well. I will go back to original version

@ZeliardM
Copy link

What did you change from plug to power strip? The process for my change is to check a box under the HomeKit (Optional) configuration to enable creating a power strip. Leave all the rest of your stuff alone and put it back to plug. That is a reference to his api that I did not change.

@roberkane212
Copy link
Author

@ZeliardM ok I must have not install yours right. Because I don’t have the option.

@roberkane212
Copy link
Author

@ZeliardM did you have to remove the original plugin, to make your changes?

@ZeliardM
Copy link

No, just need to run the following command from the terminal in the homebridge web console:
npm install ZeliardM/homebridge-tplink-smarthome

Again, I'm not responsible for anything that happens when and if you choose to do this nor will I support any problems you have.

I have told you I don't support this as it is the plugin creators invention and I'm trying to help out but I'm not taking over.

@roberkane212
Copy link
Author

roberkane212 commented Mar 20, 2024

@ZeliardM Yes thank you I appreciate it, and again if there is an issue I will go back to original. How I have ran what you told me in terminal and still don’t have the option. Thank you again for your help. I know your don’t plan to support

@ZeliardM
Copy link

Did you restart Homebridge or child bridge after you ran the command?

@roberkane212
Copy link
Author

@ZeliardM yes but when I ran the command I got a few error messages back. So I’m guessing it did not install

@ZeliardM
Copy link

Most likely, what were the error messages?

@roberkane212
Copy link
Author

roberkane212 commented Mar 20, 2024

@ZeliardM npm ERR! code 127
npm ERR! git dep preparation failed
npm ERR! command /opt/homebridge/bin/node /opt/homebridge/lib/node_modules/npm/bin/npm-cli.js install --force --cache=/home/pi/.npm --prefer-offline=false --prefer-online=false --offline=false --no-progress --no-save --no-audit --include=dev --include=peer --include=optional --no-package-lock-only --no-dry-run
npm ERR! > [email protected] prepare
npm ERR! > npm run build
npm ERR!
npm ERR!
npm ERR! > [email protected] prebuild
npm ERR! > npm run clean
npm ERR!
npm ERR!
npm ERR! > [email protected] clean
npm ERR! > rimraf lib/ build/
npm ERR! sh: 1: rimraf: not found
npm ERR! npm ERR! code 127
npm ERR! npm ERR! path /home/pi/.npm/_cacache/tmp/git-cloneUsurQf
npm ERR! npm ERR! command failed
npm ERR! npm ERR! command sh -c npm run build
npm ERR!
npm ERR! npm ERR! A complete log of this run can be found in: /home/pi/.npm/_logs/2024-03-20T16_47_49_792Z-debug-0.log

npm ERR! A complete log of this run can be found in: /home/pi/.npm/_logs/2024-03-20T16_47_37_291Z-debug-0.log

@ZeliardM
Copy link

Ah, I remember. Had to run npm install -g rimraf first. Something in the deployment missing for manually installing.

@roberkane212
Copy link
Author

roberkane212 commented Mar 20, 2024

@ZeliardM ok so run npm install-g rimraf. Then run your npm install ZeliardM/homebridge-tplink-smarthome. Right?

@ZeliardM
Copy link

Yes

@ZeliardM
Copy link

@roberkane212 any luck?

@roberkane212
Copy link
Author

@ZeliardM yes it worked thank you!!!!!

@roberkane212
Copy link
Author

@ZeliardM had to use tcp communication to get it to work though

@ZeliardM
Copy link

Ok, udp worked for me, so it could be a difference in models or something else. But glad to help.

@roberkane212
Copy link
Author

@ZeliardM it is working wonderful for me right now. Thank you so so much!!! I appreciate all your help and work. I will not be asking for anymore advise as I’m sure you have plugins you actually are apart of. However I very much appreciate you helping me to get that power strip working. I will let you know if I get upd to work, but that’s it. A million thanks, I’ve wanted this for over a year now!!

@ZeliardM
Copy link

Glad I could help and I can help where I can but specifics would have to wait on the plugin creator. Not sure if udp is required, I use it because of a bunch of errors that come up when it's tcp. I don't use any other custom entries in the plugin or settings, I just leave it all as default, if that helps.

@roberkane212
Copy link
Author

@ZeliardM i still get error logs, but it works. I don’t know how to get the error logs to go away

@ZeliardM
Copy link

I got them to go away by switching the transport in the settings to udp. But you said you had to change it to tcp.

@roberkane212
Copy link
Author

@ZeliardM I do have one more question for you if you can answer it if not I understand. do you know why I might be gettin this error now?

[TP-LINK_Power Strip_8A5D] device.send() Error: UDP Timeout after 15000ms
10.0.0.25:9999 {"system":{"get_sysinfo":{}}}
at Timeout._onTimeout (/var/lib/homebridge/node_modules/homebridge-tplink-smarthome/node_modules/tplink-smarthome-api/src/network/udp-socket.ts:64:15)
at listOnTimeout (node:internal/timers:573:17)
at processTimers (node:internal/timers:514:7)
Error: UDP Timeout after 15000ms
10.0.0.25:9999 {"system":{"get_sysinfo":{}}}
at Timeout._onTimeout (/var/lib/homebridge/node_modules/homebridge-tplink-smarthome/node_modules/tplink-smarthome-api/src/network/udp-socket.ts:64:15)
at listOnTimeout (node:internal/timers:573:17)
at processTimers (node:internal/timers:514:7)

@ZeliardM
Copy link

Is the transport udp or tcp? I think that's related to that.

@roberkane212
Copy link
Author

roberkane212 commented Mar 22, 2024

@ZeliardM UDP, however it does it on both. and didn't do it before. So I thought maybe there was something I was missing. like when I needed to install rimraf

@ZeliardM
Copy link

Hmm, I haven't seen it on my end so I'm not sure.

@roberkane212
Copy link
Author

@ZeliardM Ok no problem, I just figured I'd ask. I appreciate you taking the time

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

No branches or pull requests

2 participants