Download static HTML version of current OH4 overview

Hi,

I want to see my OH4 overview over the internet, but I do not want to open my local network and fiddle around with dynamic DNS and all of its issues.

I have a simple webspace and I would like to copy the current HTML state of OH4 to that space every 5 minutes or so.

Is there any known way how to achieve that? When just trying to wget the overview page, it returns an 404 error, which is pretty strange ?? How does OH work in the first place when the main page returns 404

I installed an openhab webhookbinding and from another server I send a command to the openhab server like this:

if curl -o /dev/null -s -w "%{http_code}\n" http://192.168.178.61:8080/webhook/CMD?Heartbeat=ON = "200"; then 
  # success
else
  # failed
fi

I switch a testitem to state „ON“ and if the result is 200 I know that openhab server is accessible AND openhab running ok (I know, I know, you cannot be sure that all components are up and running…).
You can go even further and use the item to trigger a rule in openhab and do some more stuff.

Hi thank you very much. That sound promising:)

I never worked with webhooks before though and have honestly no idea how to get started. Could you give me a good starting point what to look for? Is it something that come as standard with OH?

You are right to not want to open up your network to the Internet.

Do you just have ability to deploy a web page or can you deploy software? If the latter you’d best be served by deploying your own insurance of the openHAB Cloud Server (really you’d be best served just using the free instance provided by the openHAB Foundation).

Otherwise, you’ll need something outside of OH too scrape the OH web page and generate a static version of what you see. I know there is software that will kick off a headless version of Chromium in the background, generate a PDF or PNG of the page and put that file somewhere.

I think an app like that is going to be your best bet. Unfortunately my experience with messing with something like that is many years old at this point and I don’t remember the names of any of the tools I’ve used and this was before I was using Ansible so I don’t have old config playbooks to look at.

Yes, it is 100% openhab. Go to the settings dialog of MainUI → Add-ons Store and search for webhook under marketplace binding
this one: https://community.openhab.org/t/webhook-http-binding/152184

I use selenium for that kind of stuff. In general it is some kind of browser testing/automation API that is available for all main browsers like firefox, chrome, edge, … There are alternatives available Top 5 Selenium Alternatives For Test Automation | BrowserStack

1 Like

now I understand what a webhook is, its returning a single value.
Thats actually helpful when I just want to push certain items to the webserver. Thanks for pointing it out, might be an option.

And when looking into the topic, the headless chroming really seems to be the only option available due to the fact that everything is created with Javascript.

The CloudConnector of Openhab was not yet known to me, will definitly have a look into this, even though I wanted to untilize the ressources Im already paying for, but I cannot run OH there.

Note that this add-on will let you push commands and updates to an Item from the web server. OH’s built in API has a way for your web server to pull the state of an Item. But in both cases your web server is going to have to have networking access to your openHAB which means either a VPN of some sort (e.g. Tailscale) or exposing your openHAB to the Internet (don’t do that).

You do not run openHAB there. The openHAB Cloud Server is a Node.js application that is designed to run somewhere that is accessible to the Internet. Your openHAB instance initiates a connection to this cloud server using the Cloud Connector add-on and the Cloud Server acts as a reverse proxy.

The Cloud Server is the same software that runs https://myopenhab.org which is also a free resource you can use instead of hosting your own. Frankly, unless you just really want to control it all for some reason using the existing service is going to be your best bet. It will be orders of magnitude less work (just install the add-on and create an account) and you’ll get full access to your OH remotely, not just screen shots of the current MainUI or sitemap page.