fdebrus / hassio-addons

0 stars 1 forks source link

HA Setup vs Openhab #9

Open pergolafabio opened 1 month ago

pergolafabio commented 1 month ago

Hi, i have some time now, gonna install openhab , so i can use it on my indoor tablets

How is your setup ? are you using the MQTT discovery stream integration to expose entities to Openhab?

fdebrus commented 1 month ago

This addon does not provide any intergration, it allows OpenHAB to be installed as an AddOn to HA. When I was using it, I did the integration over HomeKit but I was exposing OpenHAB to HA. I guess the other way around is possible using the same technique.

pergolafabio commented 1 month ago

yeah, i'm aware :-)

i"m going to use this intergtation, to expose the entities to MQTT, then using some "binding" to use the mqtt entities

https://github.com/RogerSelwyn/mqtt_discoverystream_ha

pergolafabio commented 1 month ago

Hey @fdebrus , finally started with OH, what about backup ?

image

i see indeed those 2 folders, what if i setup a new instance? how can i restore the full config? do i need to copy/paste them over? any idea?

pergolafabio commented 1 month ago

i was reading about openhab, the files created manually, its as easy as copy them back with copy/paste but what about the items created in UI itself? there should be an docker "openhab-cli" , is that included in your addon? how can we do that ?

pergolafabio commented 1 month ago

image

fdebrus commented 1 month ago

I was about to say "docker exec..." then you tried. hum, I'm no longer using this addons for months, will have to refresh memory... checking

pergolafabio commented 1 month ago

ok

i checked for an docker-cli package for alpine

image

fdebrus commented 1 month ago

see https://community.openhab.org/t/openhab-cli-in-a-docker-container/137222

pergolafabio commented 1 month ago

lol, i just was tyiping there asking for confirmation :-)

pergolafabio commented 1 month ago

there is indeed no cli for docker

pergolafabio commented 1 month ago

there is indeed a backup/restore script, i just run it:

image

and its indeed backup in your mounted folder:

image

pergolafabio commented 1 month ago

the .zip contains just the 2 folders , so probably will work :-)

btw, can you update your repo to latest 4.x openhab ? :-)

fdebrus commented 1 month ago

sure thing, done, updated to 4.2.2

pergolafabio commented 1 month ago

Tested the folder backup, it contains indeed everything:-)

Are you using this addon?

fdebrus commented 1 month ago

Not anymore, I was using it to link Nikobus to HA over an OpenHAB binding. It worked but then I decided to write the integration for Nikobus to have direct connection in HA. https://github.com/fdebrus/Nikobus-HA/tree/dev

So now, I'm no longer using OpenHAB

pergolafabio commented 1 month ago

ah ok :-)

pergolafabio commented 1 month ago

hi, do you want to implement a new debug option , maybe you can add as an option, like you did with the port to start in debug mode start.sh vs start_debug.sh

https://github.com/openhab/openhab-docker/blob/main/README.md#debug-mode

fdebrus commented 1 month ago

Not working, do not know why yet... openhab not starting anymore

pergolafabio commented 1 month ago

i was trying to add a bool the config.yaml

and then:


OPENHAB_DEBUG_MODE="$(jq --raw-output '.debug_mode' $CONFIG_PATH)"

.......

# define debug mode 
if [ ! -d "${OPENHAB_DEBUG_MODE}" == "false" ]; then
  start_command="start.sh"
else
  start_command="start_debug.sh"
fi

# Use server mode with the default command when there is no pseudo-TTY
if [ "$interactive" == "false" ] && [ "$(IFS=" "; echo "$@")" == "su-exec openhab tini -s ./${start_command}" ]; then
  command=($@ server)
  exec "${command[@]}"
else
  exec "$@"
fi
pergolafabio commented 1 month ago

ah, i see you were testing it too, isnt it needed to change this in the entrypoint file instead of the dockerfile?

fdebrus commented 1 month ago

to try, no more time today :(

# Set entrypoint to handle the debug mode
ENTRYPOINT ["/bin/sh", "-c", "if [ \"$DEBUG_MODE\" = \"true\" ]; then su-exec openhab tini -s ./start_debug.sh; else su-exec openhab tini -s ./start.sh; fi"]

# CMD could remain just as a fallback in case someone overrides the entrypoint
CMD ["su-exec", "openhab", "tini", "-s", "./start.sh"]
pergolafabio commented 1 month ago

ok, np, i see an update on my repository, i wait to updat :)

fdebrus commented 1 month ago

can't make it work, not figured out why yet

java.lang.IllegalStateException: BundleContext is no longer valid org.apache.karaf.features.core_4.4.6 [19] at org.eclipse.osgi.internal.framework.BundleContextImpl.checkValid(BundleContextImpl.java:1031) at org.eclipse.osgi.internal.framework.BundleContextImpl.installBundle(BundleContextImpl.java:180) at org.eclipse.equinox.internal.region.BundleIdBasedRegion.installBundle0(BundleIdBasedRegion.java:120) at org.eclipse.equinox.internal.region.BundleIdBasedRegion.installBundleAtLocation(BundleIdBasedRegion.java:100) at org.apache.karaf.features.internal.service.BundleInstallSupportImpl.installBundle(BundleInstallSupportImpl.java:135) at org.apache.karaf.features.internal.service.FeaturesServiceImpl.installBundle(FeaturesServiceImpl.java:1145) at org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:906) at org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1069) at org.apache.karaf.features.internal.service.FeaturesServiceImpl.lambda$doProvisionInThread$13(FeaturesServiceImpl.java:1004) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) at java.base/java.lang.Thread.run(Thread.java:840)

pergolafabio commented 1 month ago

Ah ok, np, can you roll back the update? Since I see an update now on addon store :+)

I have found an API command to enable logging, so good enough

pergolafabio commented 1 month ago

If I update to 4.2.2.1 , will addon stil work in non-debug mode?

fdebrus commented 1 month ago

release 4.2.2.1 do not start openhab, it does not work stay on 4.2.2

I trusted to have erased 4.2.2.1, is it stil available for you to upgrade ?

pergolafabio commented 1 month ago

Yeah, it's still visible in your config file :-)

pergolafabio commented 3 weeks ago

Kind reminder:)

fdebrus commented 3 weeks ago

Still on vacation... will do as I return next week