A lightweight script for updating custom components for Home Assistant

Related tags

Hardware Updater
Overview

Updater for Home Assistant

Donate Donate

This is a lightweight script for updating custom components for Home Assistant. If for some reason you do not want to use HACS or cannot install it.

Pros:

  • Instant ready to use, no need to install or Hass reboot
  • No need GitHub account and token
  • Support update to latest release or latest defaul branch, even if it's not a "master"
  • Support update to specific branch or tag (version), even if the tag is not a release

Cons:

  • There is no GUI
  • Frontend integrations are not supported

Setup

  1. Add to your configuration.yaml:
switch:
  - platform: command_line
    switches:
      updater:
        friendly_name: Updater
        command_on: python updater.py update  # run updates process
        command_off: python updater.py        # force reload witout timeout
        command_state: |
          python -B -c "exec('''try: import updater\nexcept ModuleNotFoundError: from urllib.request import urlretrieve; urlretrieve('https://raw.github.com/AlexxIT/Updater/master/updater.py', 'updater.py'); import updater'''); updater.run(interval=3600)"
        command_timeout: 60  # this is timeout, not update interval!
  1. Go to Configuration > Server Controls > Reload: Command line entities

  2. Wait 30 seconds (default delay from the moment the switch is added)

  3. Edit file updater.txt in your config folder:

By default, updates to the latest release version or default branch. But you can point to any branch or any tag (version), even if the tag is not a release. Remember, some developers use the letter v in version name, some don't.

https://github.com/AlexxIT/SonoffLAN             # latest release or default branch
https://github.com/AlexxIT/Dataplicity mater     # master branch
https://github.com/AlexxIT/XiaomiGateway3 async  # custom branch
https://github.com/AlexxIT/WebRTC v2.0.1         # custom tag (version)
# https://github.com/hacs/integration            # any comments

Using

You should wait 30 seconds after Home Assistant starts for first update check.

If switch is ON - all componenst is up-to-date. You can turn it OFF to force an update check.

If switch OFF - you have an update. Turn it ON for the update.

You can delete custom_components/NAME/version.txt to force update on same version.

You can delete updater.py to update this script when the new version comes out.

You can delete updater.json to force an update check. The command line switch updates the data once an hour and caches the response in this file. To minimize the number of requests to the Internet.

You can comment line in updater.txt file to disable component update.

You can use script from command line:

python updater.py update AlexxIT/SonoffLAN AlexxIT/Dataplicity@mater AlexxIT/[email protected]
python updater.py -i 3600 json AlexxIT/SonoffLAN

Also, you can create sensor if you want. The sensor value can be updated with a delay up to 60 seconds.

sensor:
  - platform: command_line
    name: Updater
    command: python updater.py -i 3600 json
    value_template: '{{ value_json.repositories|length }}'
    unit_of_measurement: updates
    json_attributes:
      - repositories

PS: working directory should point to the Hass configuration folder. This works by default for most users.

You might also like...
Historic weather - Home Assistant custom component for accessing historic weather data

Historic Weather for Home Assistant (CC) 2022 by Andreas Frisch github@fraxinas.

Home Assistant custom component to help ev-chargers stay below peak hourly energy levels.
Home Assistant custom component to help ev-chargers stay below peak hourly energy levels.

Peaqev ev-charging Peaqev ev-charging is an attempt of charging an ev without breaching a preset monthly max-peak energy level. In order for this inte

 Python script: Enphase Envoy mqtt json for Home Assistant
Python script: Enphase Envoy mqtt json for Home Assistant

A Python script that takes a real time stream from Enphase Envoy and publishes to a mqtt broker. This can then be used within Home Assistant or for other applications. The data updates at least once per second with negligible load on the Envoy.

Universal Xiaomi MIoT integration for Home Assistant
Universal Xiaomi MIoT integration for Home Assistant

Xiaomi MIoT Raw 简体中文 | English MIoT 协议是小米智能家居从 2018 年起推行的智能设备通信协议规范,此后凡是可接入米家的设备均通过此协议进行通信。此插件按照 MIoT 协议规范与设备通信,实现对设备的状态读取及控制。

Volkswagen ID component for Home Assistant

Volkswagen ID component for Home Assistant This folder contains both a generic Python 3 library for the Volkswagen ID API and a component for Home Ass

Sensor of Temperature Feels Like for Home Assistant.

Please ⭐ this repo if you find it useful Sensor of Temperature Feels Like for Home Assistant Installation Install from HACS (recommended) Have HACS in

Интеграция Home Assistant с ЛК
Интеграция Home Assistant с ЛК "Интер РАО"

ЕЛК ЖКХ «Интер РАО» для Home Assistant Предоставление информации о текущем состоянии ваших аккаунтов в ЕЛК ЖКХ. Введение @ TODO @ Установка Посредство

Provide Unifi device info via api to Home Assistant that will give ap sensors
Provide Unifi device info via api to Home Assistant that will give ap sensors

Unifi AP Device info Provide Unifi device info via api to Home Assistant that will give ap sensors

Switch predictor for Home Assistant with AppDeamon

Home Assistant AppDeamon - Event predictor WORK IN PROGRESS - CURRENTLY NOT COMPLETE AND NOT WORK This is an idea under development (when I have free

Owner
Alex X
Lok’tar Ogar
Alex X
Home Assistant custom integration for e-distribución

e-Distribución is an energy distribution company that covers most of South Spain area. If you live in this area, you probably are able to register into their website to get some information about your power demand, energy consumption, or even cycle billing (in terms of consumptions).

VMG 17 Sep 7, 2022
Home Assistant custom integration for Yi cameras: yi-hack-MStar, yi-hack-Allwinner and yi-hack-Allwinner-v2

yi-hack Home Assistant integration Overview yi-hack Home Assistant is a custom integration for Yi cameras (or Sonoff camera) with one of the following

roleo 131 Jan 3, 2023
Custom component for Home Assistant that integrates Candy/Haier Wi-Fi washing machines (also known as Simply-Fi).

Candy Home Assistant component Custom component for Home Assistant that integrates Candy/Haier Wi-Fi washing machines (also known as Simply-Fi). This

Olivér Falvai 61 Dec 29, 2022
SALUS THERMOSTAT Custom component for Home-Assistant

Home-Assistant Custom Components Custom Components for Home-Assistant (http://www.home-assistant.io) Salus Thermostat Climate Component My device is R

null 21 Dec 18, 2022
Nordpool_diff custom integration for Home Assistant

nordpool_diff custom integration for Home Assistant Requires https://github.com/custom-components/nordpool Applies non-causal FIR differentiator1 to N

Joonas Pulakka 45 Dec 23, 2022
Smart EQ connect - Custom Integration for Home Assistant

Smart EQ Connect platform as a Custom Component for Home Assistant.

Rene Nulsch 2 Jan 4, 2022
Windhager myComfort custom component for Home Assistant

Windhager myComfort custom component for Home Assistant

null 5 Apr 27, 2022
Custom component for MPC-HC for home-assistant

mpc_hc The current mpchc integration in homeassistant violates ADR0004, so it will be deleted from core. This is just the existing integration copied

null 3 Dec 15, 2022
This Home Assistant custom component adds support for controlling Midea dehumidiferes on local network.

This is a custom component for Home assistant that adds support for Midea dehumidifier appliances via the local area network. midea-dehumidifier-lan H

Nenad Bogojevic 97 Jan 8, 2023
Resmed_myair_sensors - This is a Home Assistant custom component to pull daily CPAP data from ResMed's myAir service using an undocumented API

resmed_myair This component will set up the following platforms. Platform Description sensor Show info from the myAir API. Installation Using the tool

Preston Tamkin 17 Dec 29, 2022