homebridge-tplink-smarthome
homebridge-tplink-smarthome copied to clipboard
Move HS-300 to surge protector outlet icon
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
I currently have homebridge-tuya installed and have no issue with that plugin showing it
@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
@plasticrake what can I do to help?
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.
@ZeliardM let me know if I can help in anyway
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.
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.
@ZeliardM thats awesome. Again let me know if there’s anything I can do
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
@ZeliardM awesome, hopefully he responds to this asap
@ZeliardM I wish I knew more coding. I’d get run a local copy myself lol
@ZeliardM i see you have a forked version of the plugin. Is there anyway for me to install it by chance?
I would not as the dev hasn't tested everything and I may have made mistakes. I cannot support it like they did.
@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
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.
@ZeliardM ok I must have not install yours right. Because I don’t have the option.
@ZeliardM did you have to remove the original plugin, to make your changes?
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.
@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
Did you restart Homebridge or child bridge after you ran the command?
@ZeliardM yes but when I ran the command I got a few error messages back. So I’m guessing it did not install
Most likely, what were the error messages?
@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
Ah, I remember. Had to run npm install -g rimraf first. Something in the deployment missing for manually installing.
@ZeliardM ok so run npm install-g rimraf. Then run your npm install ZeliardM/homebridge-tplink-smarthome. Right?
Yes
@roberkane212 any luck?
@ZeliardM yes it worked thank you!!!!!
@ZeliardM had to use tcp communication to get it to work though
Ok, udp worked for me, so it could be a difference in models or something else. But glad to help.