Hi Sebastian - quick and possibly dumb question. How do I create an event listener that is triggered only by a command sent to an item, and not mere updates? ValueUpdateEvent and ValueChangeEvent seems to be triggered by updates and commands.
Troubles installing HABapp.
I’m trying to give HABApp a try but I am unable to install it. I am using OH3 on a raspberry pi 3 v1.2 with an openhabian image. I upgraded through openhabian-config to version 3.1 milestone 4. The openhabian script updated itself today. I also performed an update of raspberry-pi os, always through the openhabian interface
Installing HABApp always give an error. I set the debug log to maximum and it turns out that there is an error when performing pip install habapp. I therefore tried to issue directly the command
sudo python3 -m pip install habapp
But it always end up with an error about a directory not found. Maybe it is a silly mistake but I can’t figure out how to proceed. I would like to avoid starting completely fresh with a new openhabian install, if possible.
The output of the pip command is the following
sudo python3 -m pip install habapp
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting habapp
Using cached https://files.pythonhosted.org/packages/b3/71/6947575f5004c5abd6badf07f4b05edbb7c10cce1ce626552a132dd42017/HABApp-0.30.1-py3-none-any.whl
Collecting pendulum==2.1.2 (from habapp)
Using cached https://files.pythonhosted.org/packages/db/15/6e89ae7cde7907118769ed3d2481566d05b5fd362724025198bb95faf599/pendulum-2.1.2.tar.gz
Installing build dependencies ... done
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/lib/python3.7/tokenize.py", line 447, in open
buffer = _builtin_open(filename, 'rb')
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pip-install-dbvsk_wj/pendulum/setup.py'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-dbvsk_wj/pendulum/
o
Thanks for your answer. I actually had to use a slightly different syntax
python3 -m pip install --upgrade pip
But then the openhabian menu to install hab app still give the same error.
Strange enough if I issue the install command directly,
python3 -m pip install --upgrade habapp
it installs everything.
I am wondering wether there is some issue with openhbian installing packages as superuser.
At the end of the installation as normal user, I get some warnings,
WARNING: The script watchmedo is installed in '/home/openhabian/.local/bin' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
WARNING: The script habapp is installed in '/home/openhabian/.local/bin' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
I was under the impression that you are working with the instruction and are working in the venv.
If you follow the instructions there will be no warning and everything works fine!
Please don’t try anythign else!
create_channel_link geves an error. trying to execute
itemName=“adesso”
if not HABApp.openhab.interface.item_exists(itemName):
HABApp.openhab.interface.create_item(“DateTime”, itemName, label=‘Data e ora’, category=‘time’, tags=[], groups=[], group_type=’’, group_function=’’, group_function_params=[])if HABApp.openhab.interface.item_exists(itemName) and not HABApp.openhab.interface.channel_link_exists(“ntp:ntp:local:dateTime”, itemName):
HABApp.openhab.interface.create_channel_link(“ntp:ntp:local:dateTime”, itemName)
This definitely works, there is probably something else wrong.
Can you please use proper code fences, post the complete rule and the corresponding log entries?
Posting just the snippets makes me think that you try to run these themselves wich you should not.
Yes, Sir i will improve my coding skills. i’ve started some days ago with habapp and is very useful. thanks for your work! anyway go straight to the problem
when i issue the command
HABApp.openhab.interface.create_item(‘Number’, ‘HABApp_Ping’, label=‘HABApp_Ping’, category=‘’, tags=, groups=, group_type=‘’, group_function=‘’, group_function_params=)
log says
2021-05-13 16:48:56.972 [WARN ] [rest.core.internal.item.ItemResource] - Received HTTP PUT request at ‘items/HABApp_Ping/’ with an invalid item name ‘HABApp_Ping’.
copy/paste of your line → same result
==> /var/log/openhab/openhab.log <==
2021-05-13 17:37:34.837 [WARN ] [rest.core.internal.item.ItemResource] - Received HTTP PUT request at ‘items/HABApp_Ping/’ with an invalid item name ‘HABApp_Ping’.