Friday, May 19, 2023

Made the switch from Domoticz to Home Assistant

I ran Domoticz from mid 2019 to mid 2022 and it worked well for me.  There was good integration with ESPeasy which I used on a few ESP 8266 devices for humidity and temperature.   

I recently added a Lorawan Heltec device which is ESP32 based.  Esphome is tightly integrated with Home Assistant (HA) and after a quick review I made the switch to HA.  8 months later and so far so good.  

Home Assistant and Domoticz are two of the most popular open-source home automation platforms in 2021. Both of them can run on various devices, support a large number of smart home devices and protocols, and have active communities and plugins. However, Home Assistant has some advantages over Domoticz that make it a better choice for many users. Here are some of them:

User Interface

Home Assistant has a much smoother and shiny user interface than Domoticz, which looks a bit outdated and clunky. Home Assistant also allows users to customize the dashboard with different cards, themes, and widgets, while Domoticz has a more fixed layout.

Modularity

Home Assistant has a more modular approach than Domoticz, which means that it only loads the components that are needed for the configuration. This makes Home Assistant more efficient and flexible than Domoticz, which loads everything when started.

Discovery

Home Assistant has a better automatic discovery of devices than Domoticz, which means that it can detect and integrate many smart home devices without manual configuration. Domoticz requires users to add devices manually or use plugins for some integrations.

Add-ons

Home Assistant has a built-in add-on manager that allows users to easily install and update various add-ons that extend the functionality of Home Assistant. These include Node-RED, ESPHome, InfluxDB, Grafana, and many more. Domoticz does not have such a feature and relies on external scripts or plugins for some add-ons.

Development

Home Assistant has a more transparent and active development than Domoticz, which means that it gets more frequent updates and new features. Home Assistant also has a clear roadmap and allows users to vote for features. Domoticz has a slower development cycle and no clear roadmap or voting system.


Thursday, July 15, 2021

Raspberry PI Internet Radio

I'm current using the RPI 2b to output internet radio to the headphone jacks, which are then connected to an external amplifier and speakers. Occasionally I switch to HDMI. To get HDMI working on Raspberry Pi 2b. Simply edit /boot/config.txt to get HDMI working by uncomment this line:

hdmi_force_hotplug=1

However, this breaks headphone output. When attempting raspi-config option 7 (advanced) would not switch to headphone from HDMI for audio, so had to comment out above line.

Also, alsa mixer breaks audio controls in mopidy/iris, so need to be commented out in file: /etc/mopidy/mopidy.conf

#[audio]

#mixer = alsamixer

Mopidy still crashes on a regualar basis. There appears to be a deadlock  with http-server (tornado). At the moment, I must  restart the mopidy process on a regular basis using this command:

                sudo systemctl restart mopidy

Saturday, January 2, 2021

ESP8266 (ESPEASY) and DHT22 Temperature and Humidity Sensor - solved

The DHT22 is a good choice for adding temperature and humidity to your home automation system.  I was forced to add this device after experiencing a bad mold condition in our Munich apartment.   The sensor is helpful to show when high humidity conditions exist.

The device looks like this and there are many blog posts for connecting it with an ESP8266.






Here are the troubleshooting steps I went through to get it working on a breadboard and received no reading on the data pin.


- Tried many different GPIO pins GPIO16 caused LED to come on, switched to GPIO14 D5 and GPIO13 D7. 
- Tried 2nd sensor with no change. - Hardware setup - GPIO14 set to default, also tried input (its one wire, so must read and write). 
- Pullup is 4.7k - 3.3V, currently powering 1-wire DS18b20 - too much to power 2 devices? Lets try with 1-wire unplugged. (update - did not work). 
- Change 4.7k to 10k; did not work. 
- GPIO15-D8, GPIO12-D6 FAIL 

THE BREAD BOARD WAS THE PROBLEM! Power rails are not connected all the way across the board. Moved DHT22 next to ESP8266 and readings first time. Current setup GPIO14 with 10k pullup and 5v from Vin.






Wednesday, September 23, 2020

Resurrecting 1-wire on Raspberry Pi

These instructions worked, except I'm using parasitic power (pins 1 and 3 to ground, pin 2 to signal with 4.7k resistor to 3.3v):

https://thepihut.com/blogs/raspberry-pi-tutorials/18095732-sensors-temperature-with-the-1-wire-interface-and-the-ds18b20

Good blog here too:

https://www.raspberrypi-spy.co.uk/2013/03/raspberry-pi-1-wire-digital-thermometer-sensor/

Final result:

raspberrypi:/sys/bus/w1/devices $ ls

10-00080194a30d  w1_bus_master1

raspberrypi:/sys/bus/w1/devices $ cd 10*

raspberrypi:/sys/bus/w1/devices/10-00080194a30d $ cat w1_slave

32 00 4b 46 ff ff 09 10 94 : crc=94 YES

32 00 4b 46 ff ff 09 10 94 t=25187

raspberrypi:/sys/bus/w1/devices/10-00080194a30d $ 


Friday, August 28, 2020

Pi 2 B - Under-voltage detected! (0x00050005)

 Swapped USB charger to 2A, which seems to have resolved the low voltage issue.

Saturday, March 7, 2020

Raspberry Pi 2b Recipe


Raspberian crashed again and would not reboot.  Follow these steps to recover:

  1. Used MacOS BalenaEtcher to flash SDCard; OSMC not working latest Raspberian works
  2. Add ssh file to boot root directory; touch ssh
  3. Success ssh via wired connection; user pi - password raspberry
  4. Sudo raspi-config to configure wifi; enable vnc; enable GUI desktop
  5. Edit /etc/dhcpcd.conf with static IP for wlan0
  6. Add user to sudoer file - sudo usermod -aG sudo username
  7. Use Music on commandline (moc/mocp) as command line music player
  8. Need to install desktop - sudo apt-get install lightdm
  9. Need a desktop too  apt-get install gnome-panel gnome-settings-daemon metacity nautilus gnome-terminal (probably better off flashing desktop version of raspberian)
  10. Download vnc server or xrdp (not both) - we need a browser or VLC to play online radio
  11. To fix default display resolution: /etc/vnc/config.d/vncserver-x11-virtual:xrandr -s 1024x768
  12. Remove pulseaudio to get stereo vs mono
  13. sudo gsettings set org.gnome.desktop.lockdown disable-lock-screen 'true'

Sunday, October 27, 2019

Raspberry Pi 3.5mm Jack only output mono

Had to remove pulseaudio to get stereo out on 3.5mm jack.  Driver was limiting output to mono only.

Saturday, October 19, 2019

2019-09-26-raspbian-buster-lite.img and Ralink Technology, Corp. MT7601U Wireless Adapter

It just works, unlike EDIMAX which requires big procedure.  Using raspi-config to set SSID, etc.

Bus 001 Device 005: ID 148f:7601 Ralink Technology, Corp. MT7601U Wireless Adapter
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.01
  bDeviceClass            0
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0        64
  idVendor           0x148f Ralink Technology, Corp.
  idProduct          0x7601 MT7601U Wireless Adapter
  bcdDevice            0.00
  iManufacturer           1 MediaTek
  iProduct                2 802.11 n WLAN
  iSerial                 3 1.0
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x004a
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              160mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           8
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass    255 Vendor Specific Subclass
      bInterfaceProtocol    255 Vendor Specific Protocol
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x84  EP 4 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x85  EP 5 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x08  EP 8 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x04  EP 4 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x05  EP 5 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x06  EP 6 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x07  EP 7 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x09  EP 9 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
Binary Object Store Descriptor:
  bLength                 5
  bDescriptorType        15
  wTotalLength       0x000c
  bNumDeviceCaps          1
  USB 2.0 Extension Device Capability:
    bLength                 7
    bDescriptorType        16
    bDevCapabilityType      2
    bmAttributes   0x00000002
      HIRD Link Power Management (LPM) Supported
can't get debug descriptor: Resource temporarily unavailable
Device Status:     0x0000
  (Bus Powered)

Friday, July 7, 2017

Sprinkler control via BBB

Added Opto 22 relay with external 24AC source to control solenoid to backyard drip irrigation.

#!/bin/bash         

echo high > /sys/class/gpio/gpio67/direction
logger SPRINKLER ON

Friday, March 3, 2017

New Wifi Dongle for my Raspberry Pi

Mar  4 02:52:55 raspberrypi kernel: [178298.508653] usb 1-1.5: new high-speed USB device number 31 using dwc_otg
Mar  4 02:52:55 raspberrypi kernel: [178298.650114] usb 1-1.5: New USB device found, idVendor=148f, idProduct=7601
Mar  4 02:52:55 raspberrypi kernel: [178298.650134] usb 1-1.5: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Mar  4 02:52:55 raspberrypi kernel: [178298.650145] usb 1-1.5: Product: 802.11 n WLAN
Mar  4 02:52:55 raspberrypi kernel: [178298.650155] usb 1-1.5: Manufacturer: MediaTek
Mar  4 02:52:55 raspberrypi kernel: [178298.650165] usb 1-1.5: SerialNumber: 1.0
Mar  4 02:52:55 raspberrypi kernel: [178298.748661] usb 1-1.5: reset high-speed USB device number 31 using dwc_otg
Mar  4 02:52:55 raspberrypi kernel: [178298.881717] mt7601u 1-1.5:1.0: ASIC revision: 76010001 MAC revision: 76010500
Mar  4 02:52:55 raspberrypi kernel: [178298.883330] mt7601u 1-1.5:1.0: Firmware Version: 0.1.00 Build: 7640 Build time: 201302052146____
Mar  4 02:52:55 raspberrypi kernel: [178299.318306] mt7601u 1-1.5:1.0: Warning: unsupported EEPROM version 0d
Mar  4 02:52:55 raspberrypi kernel: [178299.318326] mt7601u 1-1.5:1.0: EEPROM ver:0d fae:00
Mar  4 02:52:56 raspberrypi kernel: [178299.490666] mt7601u 1-1.5:1.0: Error: RX urb failed:-71