Running temporary Home-Assistant on my laptop

Wanted to experiment a bit with Home-Assistant while travelling. And wanted to be able to run as much as possibly locally on the laptop instead of connecting to my home setup since network connectivity is not always reliable.

So here is a short summary how I set it up.

Docker Desktop

I already had Docker Desktop setup with a free Docker Personal account. If you do not have it setup already, download and install it.

HomeAssistant and MQTT

I found these two articles; Installing Docker, Home Assistant and Portainer on Ubuntu Linux and Configuring the Mosquitto MQTT Docker container for use with Home Assistant but they are dedicated to run Docker on Linux and since my laptop is a Mac I had to do some modifications.

Home Assistant

Create a folder on your laptop. I called mine home-assistant and then a number of subfolders in it:

mkdir home-assistant
cd home-assistant
mkdir homeassistant
mkdir homeassistant/config

Then run code docker-compose.yml and add

version: '3.0'
services:
  homeassistant:
    container_name: homeassistant
    image: "ghcr.io/home-assistant/home-assistant:stable"
    volumes:
      - ./homeassistant/config:/config
      - /etc/localtime:/etc/localtime:ro
      - /run/dbus:/run/dbus:ro
    restart: unless-stopped
    privileged: true
    ports:
      - 8123:8123

Mosquitto

Optionally if you want to run Mosquitto for MQTT

mkdir mosquitto
mkdir mosquitto/data  
mkdir mosquitto/logmkdir mosquitto/config

Then run code mosquitto/config/mosquitto.conf and add

persistence true
persistence_location /mosquitto/data/
log_dest file /mosquitto/log/mosquitto.log
password_file /mosquitto/password_file

And add to docker-compose.yml

  mosquitto:
    image: eclipse-mosquitto
    container_name: mosquitto
    volumes:
      - ./mosquitto:/mosquitto
      - ./mosquitto/data:/mosquitto/data
      - ./mosquitto/log:/mosquitto/log
    ports:
      - 1883:1883
      - 9001:9001    

Start container/s

Then start the the container or containers with docker compose like

docker-compose up -d

Then visit localhost:8123 to create account and start using Home-Assistant

Wiring MakerX – remote receiver

Some documentation of my wiring to the MakerX VESC since I am about to connect a BRemote instead of the Maytech one.

VESCFirst cableSecondThirdFourthMaytech RxBRemote Rx V1.3
PPM
SigYellowOrangeYellowOrangePWMSRV
5VRedNC
GNDBlackNC
COMM 
AUXBrownNC
MISO_ADC_EXT2OrangeNC
TX_SDA_NSSWhitePurplePinkPurpleRXDTX2
RX_SCL_MOSIBlueGreyGreyGreyTXDRX2
SCK_ADC_EXT1GreenNC
GNDBlackBlackBlueBlackGNDGND
3.3VYellowNC
5VRedRedRedRed5V5V
Other
Battery +GreenGreenBrownGreyBATBMS+
Motor phaseBlueBlueWhiteWhiteMOT

Extruder calibration on the Snapmaker A250

This article on the Snapmaker forum outlines how to do it. https://forum.snapmaker.com/t/extruder-calibration-a-must/7724/33

I use the calibration card to measure and cut the filament at 10 on the card, i.e 100mm plus the dead space before the 0. But since I measure the extruded distance also with this space it can be ignored.

Make sure the hot end has reached the correct temperature for the filament you are calibrating with. And issue the command to start feeding the 100mm of filament. Once that finished measure the amount of filament left.

I had 23mm left this time. Then it is time to do the calculation. I find it easiest to start the developer tools in the browser. In the console there I just enter the expressions in the article.

Then use the Luban console to enter the newly calculated value and permanently store it. If you want to understand the M-commands like M92 this page was good, https://snapmaker.github.io/Documentation/gcode/M092

Finally make a test run with the same command that feeds 100mm of filament. Mine fed a few mm of extra filament.

This time I ignored the difference but if you want you can re-calibrate. Use your calculated S value as the new E in the calculation and enter how much filament that has been fed. Repeat until you are satisfied.

Alternatives to get Nexa support in Home Assistent

I found the OpenMQTTGateway project and got really interested since it can open up for a lot of interesting integrations to Home Assistant. I bought a LilyGo to start experimenting and could get it to read 433Mhz devices like Nexa. All this is possible due to the RTL_433_ESP library.

I wanted also to be able to write to the devices since I have several power plugs that use Nexa. That is not possible with just the LilyGo and the radio module on it. With the STX882 it should be possible to transmit. So I bought both a STX882 and a SRX882. This page describes how to connect these to a ESP32 or NodeMCU.

Have not yet tried to make the full setup and connect everything. Will update this post once I have tried that.