Open StoreEverything opened 2 years ago
After making the above change to the file on my local machine, once I reloaded homebridge the AC units are all found as expected.
Either the AC_DEVICE_NAME needs to be updated to the suggest change, or the code needs adjusting so that more than one AC_DEVICE_NAME can be checked when looking at the api response for legacy AC units.
I believe a firmware update pushed to the AC units changed the reported device name in the api.
I now have two types of Device Name
"name":"Air Conditioner" and "name":"Samsung Room A/C"
Not nice, not clean, not best solution, but works.
const AC_DEVICE_NAME = 'Samsung Room A/C'; const AC_DEVICE_NAME_2 = 'Air Conditioner';
return items.filter(item => item.name === AC_DEVICE_NAME || item.name === AC_DEVICE_NAME_2);
Hi, i've installed this plugin in my hombebridge on raspberry pi. Where i can find the samsungApi.ts file to edit it so the plugin finds my ACs.
thnx.
is on /homebridge/node_modules/homebridge-samsung-air-conditioner-smart-things/dist/samsungApi.js
Hi, i've installed this plugin in my hombebridge on raspberry pi. Where i can find the samsungApi.ts file to edit it so the plugin finds my ACs.
thnx.
Just wanted to say thanks @StoreEverything! Total newbie here, just installed Homebridge on an Rpi yesterday and managed to get my Tapo Lights/Plugs, SwitchBot Locks, Ring Cameras/Security devices, Smart Blinds and LG TV up and running alongside all my native HomeKit devices. My Samsung WindFree ACs were the only thing I couldn’t manage to get into HomeKit until I found your advice in this thread.
Just to pay it forward, for those (like me) that don’t know what you’re doing, this fix works perfectly right within the HomeBridge UI with the following steps:
Launch Terminal from the menu (three dots/hamburger) at the upper right corner of your HomeBridge UI.
Type: cd node_modules/homebridge-samsung-air-conditioner-smart-things/dist
this just opens the folder/directory where the js file you need to edit is saved. Thanks to @manieridimambro for pointing me in the right direction.
Type: nano samsungApi.js
noting that this is case-sensitive. This will open the text editor in terminal.
Modify the highlighted code, replacing the outdated code as described by @StoreEverything at the start of this thread:
Once you’re done, use the keyboard shortcut ‘Ctrl+X’ to exit the text editor and ‘Y’ to save your edits.
Type exit to finish up in Terminal and restart HomeBridge.
That’s it… You should now see your Samsung AC unit(s) appear in the Home app! This should do the trick, at least until one of the PRs for the plug-in is accepted/published.
Thank you, @StoreEverything for this fix, and @manieridimambro and @FLgator86 for explaining how to implement it. This worked like a charm!
Just wanted to say thanks @StoreEverything! Total newbie here, just installed Homebridge on an Rpi yesterday and managed to get my Tapo Lights/Plugs, SwitchBot Locks, Ring Cameras/Security devices, Smart Blinds and LG TV up and running alongside all my native HomeKit devices. My Samsung WindFree ACs were the only thing I couldn’t manage to get into HomeKit until I found your advice in this thread.
Just to pay it forward, for those (like me) that don’t know what you’re doing, this fix works perfectly right within the HomeBridge UI with the following steps:
- Launch Terminal from the menu (three dots/hamburger) at the upper right corner of your HomeBridge UI.
- Type:
cd node_modules/homebridge-samsung-air-conditioner-smart-things/dist
this just opens the folder/directory where the js file you need to edit is saved. Thanks to @manieridimambro for pointing me in the right direction.- Type:
nano samsungApi.js
noting that this is case-sensitive. This will open the text editor in terminal.- Modify the highlighted code, replacing the outdated code as described by @StoreEverything at the start of this thread:
- Once you’re done, use the keyboard shortcut ‘Ctrl+X’ to exit the text editor and ‘Y’ to save your edits.
- Type exit to finish up in Terminal and restart HomeBridge.
That’s it… You should now see your Samsung AC unit(s) appear in the Home app! This should do the trick, at least until one of the PRs for the plug-in is accepted/published.
It seems on my side the device name on the API for my aircon is "Samsung-Room-Air-Conditioner". The best approach might be to use the steps above to identify your aircon name and potentially override the constant value using a config value if presented.
It seems on my side the device name on the API for my aircon is "Samsung-Room-Air-Conditioner". The best approach might be to use the steps above to identify your aircon name and potentially override the constant value using a config value if presented.
thank you!
i visited the API devices page (https://api.smartthings.com/v1/devices) and found mine was also "Samsung-Room-Air-Conditioner"
all working now.
simply and clever solution:
const AC_DEVICE_NAMES = ['Samsung Room A/C','Air Conditione'];
...
...
...
return items.filter(item => AC_DEVICE_NAMES.includes(item.name));
@FLgator86 @StoreEverything @armandkamffer Where can I find and edit the file mentioned in you step 2 ?
When I tap the command cd node_modules/homebridge-samsung-air-conditioner-smart-things/dist
in my terminal, it doesn’t open the file, instead I get the message "cd: no such file or directory: node_modules/homebridge-samsung-air-conditioner-smart-things/dist"
I found my answer : if you installed Homebridge on MacOS, the file you need to edit (samsungApi.js) is in : /usr/local/lib/node_modules/homebridge-samsung-air-conditioner-smart-things/dist
To find it, you first need to show hidden files in you Finder. To do so you can use (when you are in you Finder) the shortcut : Command + Shift + .
I installed Homebridge on Linux, where can I find and edit the file?
I installed Homebridge on Linux, where can I find and edit the file?
when I paste the command: cd node_modules/homebridge-samsung-air-conditioner-smart-things/dist i get the messege: bash: cd: node_modules/homebridge-samsung-air-conditioner-smart-things/dist: No such file or directory
I have 3 AC units. All of them used to work fine before. Doing this recommended fix gets one of them working. Any idea how to get the other 2? thanks
simply and clever solution:
const AC_DEVICE_NAMES = ['Samsung Room A/C','Air Conditione']; ... ... ... return items.filter(item => AC_DEVICE_NAMES.includes(item.name));
How would I use this to loop through different device names? I have 3 units, called: "name":"Samsung Room A/C" "name":"Samsung-Room-Air-Conditioner" "name":"Samsung-Room-Air-Conditioner"
Thanks
simply and clever solution:
const AC_DEVICE_NAMES = ['Samsung Room A/C','Air Conditione']; ... ... ... return items.filter(item => AC_DEVICE_NAMES.includes(item.name));
How would I use this to loop through different device names? I have 3 units, called: "name":"Samsung Room A/C" "name":"Samsung-Room-Air-Conditioner" "name":"Samsung-Room-Air-Conditioner"
Thanks
Got it working. The return items.filter line needs to replace the line in the getDevices block.
when I paste the command: cd node_modules/homebridge-samsung-air-conditioner-smart-things/dist i get the messege: bash: cd: node_modules/homebridge-samsung-air-conditioner-smart-things/dist: No such file or directory
Type: cd /usr/lib/node_modules/homebridge-samsung-air-conditioner-smart-things/dist this just opens the folder/directory where the js file you need to edit is saved. Thanks to @manieridimambro for pointing me in the right direction.
Type: nano samsungApi.js noting that this is case-sensitive. This will open the text editor in terminal.
For me, the change was
const AC_DEVICE_NAME = '[system a/c] Samsung';
https://github.com/teodoradima/homebridge-samsung-air-conditioner-smart-things/blob/4c6405a9e0c31c89bf0b7dec0ebcab46c082e143/src/samsungApi.ts#L3
Looking at API response, should this change to
const AC_DEVICE_NAME = 'Samsung Room A/C';