UPDATED: Hassio in Docker with PostgressDB on RapsberryPI and AzureVM

Hey guys
Like to share my configuration with a dark and light theme. Theme can be changed based on a input boolean. Themes are fully Material Icon based.
Still working on the dark/light theme thing on the MAP. You have to set dark-theme option manually to true/false.
I’ve used several integrations like: HUE, Zigbee2MQTT, Garmin, Brother, IOS and DSMR-Reader

I’ve setup the infrastructure on a Raspberry PI with Ubuntu and an Azure VM with also Ubuntu. Both are installed with Docker. On the Rapsberry PI i’ve installed DSMR-Reader, Hassio and Portainer. On the Azure site i’ve installed also Docker with Postgress.
Im using StrongSwan for the IPSEC connection between home and Azure. The whole config and setup is explained on my repo.

The automation part is filled in with Node-Red.

Short roadmap:
Automatic change the MAP card theme based on the selected theme;
Adding cards with Brother and Garmin info.

Screenshots



If you have any suggestion, feel free :slight_smile:

UPDATED 20-03-2020:
Added IPSec connection to my Azure VM monitor via command_line sensor.

Also added in node-red auto change theme light <-> dark.
See my node-red export in the repo.

1 Like

hi, could you share your docker-compose.yaml or build method to install DSRM_reader next to hassio in portainer. I cant get it to work :frowning:

Hello, ive used the steps mentioned at https://github.com/xirixiz/dsmr-reader-docker
The code i’ve used:

docker run -d \
  --name dsmr \
  --restart always \
  -p 7777:80 \
  -p 7779:443 \
  -e TZ=Europe/Amsterdam \
  -e DB_HOST=x.x.x.x \
  -e DB_USER=dsmrreader \
  -e DB_PASS=dsmrreader \
  -e VIRTUAL_HOST=localhost \
  --device /dev/ttyUSB0:/dev/ttyUSB0 \
  xirixiz/dsmr-reader-docker

you also need a postgres database installed. Please check my repo for postgres installation instructions.

thanks, managed to get it working using a docker_compose file in portainer(add stack) and manually created 2 volumes which i attached to both containers. Then the containers started up!

I want to get the same layout as your power overview! i guess its done using MQTT, but after setting it up i still dont receive messages in the MQTT broker although it works using MQTT explorer. Next problem :wink:

version: '2.0'

services:
  dsmrdb:
    image: postgres:10.5-alpine
    container_name: dsmrdb
    restart: always
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - ./dsmrdb:/var/lib/postgresql/data
    environment:
      - TZ=Europe/Amsterdam
      - PG_TZ=Europe/Amsterdam
      - POSTGRES_USER=dsmrreader
      - POSTGRES_PASSWORD=dsmrreader
      - POSTGRES_DB=dsmrreader

  dsmr:
    image: xirixiz/dsmr-reader-docker:arm32v6
    container_name: dsmr
    depends_on:
      - dsmrdb
    cap_add:
      - NET_ADMIN    
    links:
      - dsmrdb
    restart: always
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - ./dsmr_backups:/dsmr/backups
    environment:
      - TZ=Europe/Amsterdam
      - VIRTUAL_HOST=localhost
      - SD_AUTOSTART_MQTT=false
      - SD_AUTORESTART_MQTT=false
    ports:
      - 7777:80
      - 7779:443
    devices:
      - /dev/ttyUSB0:/dev/ttyUSB0

#volumes:
#   dsmrdb:
#   dsmrdb_backups:

Thats correct. I’ve setup the MQTT part in dsmr-reader. At output im using JSON output instead of telegram.

Please check the yaml file in my repo for the sensors.
https://github.com/srozemuller/hassio-config/blob/b4739110ee840363a748739fcb71ff2496918886/sensors/dsmr.yaml

i never got the MQTT readout in hassio to work with dsmr-reader. dsmr reader is sending, i can send to the mosquito server using the MQTT explorer tool, but in mosquitto i dont see any input from the dsmr-reader. I tried using the Pi’s IP and the internal (portainer) IP, but there is no connection

Do you have output in DSRM-Reader itself?
You can see the messages at http://dsrmreaderURL//admin/dsmr_mqtt/message/

For the messages i’ve used Telegram: JSON

I assume you filled in the MQTT broker settings in page http://dsrmreaderURL/admin/dsmr_mqtt/mqttbrokersettings/

yess, i could see the output in DSRM itself, but i finally found out i had to change the DSMR-reader MQTT hostname to the internal docker name of Mosquitto: addon_core_mosquitto. Then it started working. Using the external IP of raspberry, or the internal IP of mosquitto didnt work for me.

Soo solved! Now checking what parts of your setup i could also implement :slight_smile: thanks for helping!

good to hear… happy logging