HASS on mobile now auto rotates? :(

I noticed that recently (I believe since I’m on 0.28.2) the HASS webpage autorotates when having I open it on a mobile.
I really hate that. I never use auto rotate especially when lying in bed.

Was this feature introduced? Can’t it be made optional?

What device? What app?

HASS (Home Assistant) doesn’t have an app. So it’s just the webpage.
Device both on Android Sony Compact Z3 and Android Samsung A3.

So this is probably a function of your phone or browser, not HASS.

Auto rotation depends on your OS (Android) settings and on the app, so the browser in this case. A webpage cannot define this behaviour.

I’ve been using HASS since version 0.21 or 0.22, and it has always rotated on my Android devices for as long as I can remember (using it in Chrome primarily).

Hmmm well I can’t recall that it rotated before so then it’s maybe a recent phone update (on both of my phones).
In the browser itself it doesn’t auto rotate by the way.
Only when I open the shortcut (created 1 time when opening in Chrome browser), it autorotates.

That shortcut doesn’t seem to open the Chrome browser (though I did create the shortcut through the Chrome browser).
However a shortcut created to for instance the imdb website does open the browser (and doesn’t auto rotate).

So I guess a shortcut doesn’t work for me (due to the auto rotating) and I’ll need to first open the browser and then go to the HASS page.

Hi PuckStar,

If you take a look at the init.py file you can see that the manifest.json file is built dynamically. manifest.json is a web standards way of letting a web site run like an application, e.g. how it gets pinned to your home screen. You should be able to change line 21 from:
“display”: “standalone”,
“display”: “portrait”,

Let me know if it works for you. This could be a (yet another :wink: ) config option?

Otherwise you’d have to change this with every update / make sure it was always there. It would be easy to write a sed command line one liner and put this into your start up script which would make it survive updates of the homeassistant python package.


Many thanks for your reply! I will check it tonight when I’m home again.

I was quite sure it’s something in HASS itself. However I am doubting if I am correct in that it changed after an update or that it was like this since the beginning.

Anyway I’ll try your “fix” and if it works I would strongly suggest to make it optional in HASS. Any idea how we can raise that with the devs? Perhaps just a message to balloob?

any idea where I can find that file when I used the AIO installer? Tried a lot of directories (via WinSCP) but can’t seem to find that Frontend folder and init file.

I believe it’s /srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/components/frontend/__init__.py

Ok I found the file and changed the text but no affect.
I also tried to change “orientation” to portrait, but also no affect.
I restarted HASS after each try call hass_restart from with hass.
Is that the proper way?
Do you have any other idea?

+1 for a fix for me too. Switching off the auto rotate will be very useful.

This also happens to me, but I think it must be a bug in Chrome. Viewing the page normally (in the browser) doesn’t rotate, but if it’s a “web app” (shortcut on home screen) then it rotates.

There is a solution described here: http://stackoverflow.com/questions/39967294/web-app-manifest-setting-of-the-default-orientation-is-ignored

The manifest needs both “display” and “orientation” settings, like this:

  "display": "standalone",
  "orientation": "portrait",

edit: I just realised this isn’t a good solution for people who use tablets in landscape mode. The orientation should respect the user’s device settings, but it doesn’t.

1 Like