My first steps discovering Home Assistant, setting up a HA client to an existing MQTT Broker

Unless I’m completely misunderstanding something (which is entirely likely)…

I don’t think a reverse proxy or SSL is much safer than using just a password to access your HA system.

I mean, yes it is a little better due to the encryption that SSL affords so no one can snoop on your external traffic. And a reverse proxy shields you somewhat from an attack on your server, But unless you have additional security set up on your proxy (which from most of the examples I’ve seen here most people don’t) you are still just using the reverse proxy to forward traffic to your machine.

All of this still just amounts to having an obvious open port and then you just being protected by a single password.

IP bans are better but a determined attacker could probably get around that, too, I would suppose.

Maybe the new authentication system will be a little safer but as easy as it was for me to set up a VPN using PiVPN on a spare RPi, I really fail to see the objection to it from the average user’s point of view.

Am I missing something?

Hell if I know lol
Seriously, I think vpn is at least as safe as most options, just doesn’t seem to get much love here so I was wondering why.

Interesting thread even if it sounds more like it is fort knox that should be protected and notHA

I guess I don’t understand the comment…

Do you have your door locks controlled from HA? Your garage doors? Do you have security camera’s that display in HA? Do you have an alarm panel controlled from HA?

If none of those apply to you and you just control your lights then yes I can see where a lot of this might be complete overkill.

If you have any of those things I listed above integrated into HA then I don’t see why you wouldn’t want to treat your house as close to being protected like Fort Knox as possible.

Otherwise, just leave your house keys by your front door at night. It’s kind of close to the same thing.

I have all of that but it does not mean that I am paranoid about the security. It is ofc up to everyone to estimate the risk but I doubt after a life in the computer industry that anyone will make the effort to penetrate the security of a normal house. It is still a limited group of people who has the skills for it and I dont think ransackers of private houses belongs to that group.
But as I said it is up to you to decide

I agree with that.

However, if something is easy enough to do and fairly inexpensive then I don’t see why not.

Cheers :grinning:

The more complex, the more risk of failure has been my motto since I started with computers long before windows and Linux. We used a OS called CP/M

Just something I want to mention, security is not only used for privacy breaches. If your device is compromised it could be becoming part of a botnet or infected with a virus which could try to infect other devices on your LAN.

Good point.

Managed to get it working! Thanks @gpbenton! :+1:

I have an other problem, though… :roll_eyes:

I updated HA to 0.76.0 using commands:
as PY virtual environment user homeassistant: pip3 install --upgrade homeassistant
as Pi user:
sudo systemctl --system daemon-reload
sudo systemctl stop [email protected]
sudo systemctl start [email protected]

Now I got an extra window in my HA frontend:
afbeelding

I tried to update the pip-installation, because during HA upgrade this text was showing up:

You are using pip version 10.0.1, however version 18.0 is available.
You should consider upgrading via the ‘pip install --upgrade pip’ command.

So I did, but it was not solving my problems. My logfile content is:

2018-08-19 19:32:37 ERROR (Recorder) [homeassistant.components.recorder.util] Error executing query: (sqlite3.OperationalError) duplicate column name: context_id [SQL: ‘ALTER TABLE events ADD COLUMN context_id CHARACTER(36)’] (Background on this error at: Error Messages — SQLAlchemy 2.0 Documentation) 2018-08-19 19:32:37 ERROR (Recorder) [homeassistant.components.recorder] Error during connection setup: (sqlite3.OperationalError) duplicate column name: context_id [SQL: ‘ALTER TABLE events ADD COLUMN context_id CHARACTER(36)’] (Background on this error at: Error Messages — SQLAlchemy 2.0 Documentation) (retrying in 3 seconds) 2018-08-19 19:32:40 ERROR (Recorder) [homeassistant.components.recorder.util] Error executing query: (sqlite3.OperationalError) duplicate column name: context_id [SQL: ‘ALTER TABLE events ADD COLUMN context_id CHARACTER(36)’] (Background on this error at: Error Messages — SQLAlchemy 2.0 Documentation) 2018-08-19 19:32:40 ERROR (Recorder) [homeassistant.components.recorder] Error during connection setup: (sqlite3.OperationalError) duplicate column name: context_id [SQL: ‘ALTER TABLE events ADD COLUMN context_id CHARACTER(36)’] (Background on this error at: Error Messages — SQLAlchemy 2.0 Documentation) (retrying in 3 seconds) 2018-08-19 19:32:43 ERROR (Recorder) [homeassistant.components.recorder.util] Error executing query: (sqlite3.OperationalError) duplicate column name: context_id [SQL: ‘ALTER TABLE events ADD COLUMN context_id CHARACTER(36)’] (Background on this error at: Error Messages — SQLAlchemy 2.0 Documentation) 2018-08-19 19:32:43 ERROR (Recorder) [homeassistant.components.recorder] Error during connection setup: (sqlite3.OperationalError) duplicate column name: context_id [SQL: ‘ALTER TABLE events ADD COLUMN context_id CHARACTER(36)’] (Background on this error at: Error Messages — SQLAlchemy 2.0 Documentation) (retrying in 3 seconds) 2018-08-19 19:32:44 WARNING (MainThread) [homeassistant.setup] Setup of recorder is taking over 10 seconds. 2018-08-19 19:32:46 ERROR (Recorder) [homeassistant.components.recorder.util] Error executing query: (sqlite3.OperationalError) duplicate column name: context_id [SQL: ‘ALTER TABLE events ADD COLUMN context_id CHARACTER(36)’] (Background on this error at: Error Messages — SQLAlchemy 2.0 Documentation) 2018-08-19 19:32:46 ERROR (Recorder) [homeassistant.components.recorder] Error during connection setup: (sqlite3.OperationalError) duplicate column name: context_id [SQL: ‘ALTER TABLE events ADD COLUMN context_id CHARACTER(36)’] (Background on this error at: Error Messages — SQLAlchemy 2.0 Documentation) (retrying in 3 seconds) 2018-08-19 19:32:49 ERROR (Recorder) [homeassistant.components.recorder.util] Error executing query: (sqlite3.OperationalError) duplicate column name: context_id [SQL: ‘ALTER TABLE events ADD COLUMN context_id CHARACTER(36)’] (Background on this error at: Error Messages — SQLAlchemy 2.0 Documentation) 2018-08-19 19:32:49 ERROR (Recorder) [homeassistant.components.recorder] Error during connection setup: (sqlite3.OperationalError) duplicate column name: context_id [SQL: ‘ALTER TABLE events ADD COLUMN context_id CHARACTER(36)’] (Background on this error at: Error Messages — SQLAlchemy 2.0 Documentation) (retrying in 3 seconds) 2018-08-19 19:32:52 ERROR (Recorder) [homeassistant.components.recorder.util] Error executing query: (sqlite3.OperationalError) duplicate column name: context_id [SQL: ‘ALTER TABLE events ADD COLUMN context_id CHARACTER(36)’] (Background on this error at: Error Messages — SQLAlchemy 2.0 Documentation) 2018-08-19 19:32:52 ERROR (Recorder) [homeassistant.components.recorder] Error during connection setup: (sqlite3.OperationalError) duplicate column name: context_id [SQL: ‘ALTER TABLE events ADD COLUMN context_id CHARACTER(36)’] (Background on this error at: Error Messages — SQLAlchemy 2.0 Documentation) (retrying in 3 seconds) 2018-08-19 19:32:55 ERROR (Recorder) [homeassistant.components.recorder.util] Error executing query: (sqlite3.OperationalError) duplicate column name: context_id [SQL: ‘ALTER TABLE events ADD COLUMN context_id CHARACTER(36)’] (Background on this error at: Error Messages — SQLAlchemy 2.0 Documentation) 2018-08-19 19:32:55 ERROR (Recorder) [homeassistant.components.recorder] Error during connection setup: (sqlite3.OperationalError) duplicate column name: context_id [SQL: ‘ALTER TABLE events ADD COLUMN context_id CHARACTER(36)’] (Background on this error at: Error Messages — SQLAlchemy 2.0 Documentation) (retrying in 3 seconds) 2018-08-19 19:32:58 ERROR (Recorder) [homeassistant.components.recorder.util] Error executing query: (sqlite3.OperationalError) duplicate column name: context_id [SQL: ‘ALTER TABLE events ADD COLUMN context_id CHARACTER(36)’] (Background on this error at: Error Messages — SQLAlchemy 2.0 Documentation) 2018-08-19 19:32:58 ERROR (Recorder) [homeassistant.components.recorder] Error during connection setup: (sqlite3.OperationalError) duplicate column name: context_id [SQL: ‘ALTER TABLE events ADD COLUMN context_id CHARACTER(36)’] (Background on this error at: Error Messages — SQLAlchemy 2.0 Documentation) (retrying in 3 seconds) 2018-08-19 19:33:01 ERROR (Recorder) [homeassistant.components.recorder.util] Error executing query: (sqlite3.OperationalError) duplicate column name: context_id [SQL: ‘ALTER TABLE events ADD COLUMN context_id CHARACTER(36)’] (Background on this error at: Error Messages — SQLAlchemy 2.0 Documentation) 2018-08-19 19:33:01 ERROR (Recorder) [homeassistant.components.recorder] Error during connection setup: (sqlite3.OperationalError) duplicate column name: context_id [SQL: ‘ALTER TABLE events ADD COLUMN context_id CHARACTER(36)’] (Background on this error at: Error Messages — SQLAlchemy 2.0 Documentation) (retrying in 3 seconds) 2018-08-19 19:33:05 ERROR (Recorder) [homeassistant.components.recorder.util] Error executing query: (sqlite3.OperationalError) duplicate column name: context_id [SQL: ‘ALTER TABLE events ADD COLUMN context_id CHARACTER(36)’] (Background on this error at: Error Messages — SQLAlchemy 2.0 Documentation) 2018-08-19 19:33:05 ERROR (Recorder) [homeassistant.components.recorder] Error during connection setup: (sqlite3.OperationalError) duplicate column name: context_id [SQL: ‘ALTER TABLE events ADD COLUMN context_id CHARACTER(36)’] (Background on this error at: Error Messages — SQLAlchemy 2.0 Documentation) (retrying in 3 seconds) 2018-08-19 19:33:05 ERROR (MainThread) [homeassistant.setup] Setup failed for recorder: Component failed to initialize. 2018-08-19 19:33:05 ERROR (MainThread) [homeassistant.setup] Unable to setup dependencies of history. Setup failed for dependencies: recorder 2018-08-19 19:33:05 ERROR (MainThread) [homeassistant.setup] Setup failed for history: Could not setup all dependencies. 2018-08-19 19:33:05 ERROR (MainThread) [homeassistant.setup] Unable to setup dependencies of logbook. Setup failed for dependencies: recorder 2018-08-19 19:33:05 ERROR (MainThread) [homeassistant.setup] Setup failed for logbook: Could not setup all dependencies.

Ehh, Help? :scream:

It looks like you have a corrupted database - which seems to happen from time to time. Delete the file home-assistant_v2.db in your homeassistant configuration directory and I think it will be fine.

You will lose your sensor history, but that is normally purged after a few days anyway.

1 Like

@gpbenton, that’s all!? Why didn’t think of that… :roll_eyes:

Thank you, that did the trick! :vulcan_salute:

1 Like

Just one question, before I close this topic as ‘Solved’.

How can I configure a value to publish to a MQTT topic by, lets say, a HA switch?