Since it has been proven that the new Amazon Echo binding items slow down the system to a crawl, I’m trying to programmatically enable/disable them by moving the amazon.items file out of the items directory when not needed and move them back if needed (e.g. If SceneSelector=100/Party enable the items so I can stream through my living room Echo)
I have created two scripts (e.g. “mv /etc/openhab2/items/unused/amzn.items /etc/openhab2/items/” ) but I’m struggling with permissions. If I try adding the “sudo -u openhabian” in the script I get a banner from sudo and if I don’t the script fails with Permission Denied.
Does that work? i.e. removing an xxx.items file after openHAB has already read it, makes the Items disappear from registry? (How would it know which Items to remove, I wonder)
Andrew, hereafter the articles I should have mentioned in my opening post.
Anyway, if you have the binding enabled, try having one thing/item/channel configured and the access http://yourip:8080/rest/items with and without the thing and notice the difference
I guess it is the same mechanism that detects a change in a .items file, indeed if you look at the logs (I always have frontail’s page open during changes) you can see the items being added/removed
MDAR
(Stuart Hanlon, UK importer of Velbus hardware)
10
Honestly, I don’t use scripts.
If I were trying what you’re looking for, I’d just put this pair of commands in Exec binding Things and fire each one as required, by linking the Run channel
I use Habpanels on my rpi3 or phone and the loading of the dashboards is extremely slow and many times it shows LOST CONNECTION at bottom-left of the dashboard.
Also if you try with any REST browser (I use ARC as a Chrome extension), you will notice that performing a GET on http://x.x.x.x:8080/rest/items takes from 500ms WITHOUT to 6-7 sec WITH those items enabled
OMG!!! @s1r is totally correct!!!
Anyone running the Amazon Echo binding needs to try this!!!
Renaming the file that contains my Amazon Echo items from .items to .BAK
GET request to OpenHAB REST api on host machine
no Amazon Echo items = 11 ms
with Amazon Echo items = 1300 - 1700 ms
I know the Amazon Echo binding uses the web api, is this all down to internet latency?
I have now placed them into an amazon_slow.items file that I keep in the /etc/openhab2/items/backup directory and move them into /items only when I need to use that given echo device. Same thing has to be done for the .things file
I have a SceneSelector item that when =100 moves the file, turns on some lights and starts a Party playlist.
Hi, I also cannot mv a file or cp and rm due to permission errors.
sudo -u openhab mv file1.sh file2.sh
I already added openhab to sudoers as mentioned here.
So for adding the user openhab with no password:
sudo visudo -f /etc/sudoers.d/010_pi-nopasswd
I added
openhab ALL=(ALL) NOPASSWD: ALL
I also added directly into sudo visudo
openhab ALL=(ALL:ALL) ALL
What am I missing? I am able to execute through executeCommandLine python scripts but when I use a library to move such as shutil shutil.mv I return to same issue of permission errors.