Code Monkey home page Code Monkey logo

radioactivity_hu's Introduction

hacs_badge

Buy me a coffee

Home Assistant custom integration for Radioactivity data for Hungary

This custom component integrates radioactivity information provided by Disaster Recovery Directorate (Katasztrófavédelem).

The state of the sensor will be the level of the environmental radioactivity. Thresholds are defined on the bottom of the page Háttérsugárzás - Aktuális adatsor

Installation

The easiest way to install it is through HACS (Home Assistant Community Store), search for Radioactivity Hungary in the Integrations.

Configuration:

Define sensor with the following configuration parameters:


Name Optional Default Description
name Y radioactivity_hu name of the sensor
station Y `` name of the measuring station (see below)

Measuring station name should match the 'Állomás' specified at Háttérsugárzás - Aktuális adatsor. When not set the component will scan all active stations with measurement data not older than two days and the state of the sensor will be the highest level of measurement from this set of stations. The attributes (station, last_measurement_time) will be set as per the station with the highest level of measurement.

Example of radioactivity information:

Radioactivity attributes

Examples

platform: radioactivity_hu

Example Lovelace UI custom button card:

type: custom:button-card
color_type: icon
show_label: true
show_name: false
show_icon: true
entity: sensor.radioactivity_hu
size: 30px
styles:
  label:
    - font-size: 90%
    - text-align: left
  card:
    - height: 80px
  icon:
    - color: >
        [[[
          var r_val = states['sensor.radioactivity_hu'].state;
          if ( r_val > 500 ) {
            return "red";
          } else if ( r_val > 250 ) {
            return "var(--paper-item-icon-active-color)";
          }
          return "var(--paper-item-icon-color)";
        ]]]
label: radioaktivitás

Radioactivity button

Thanks

Thanks to all the people who have contributed!

contributors

radioactivity_hu's People

Contributors

amaximus avatar nagyrobi avatar wrt54g avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

radioactivity_hu's Issues

a station but it doesn't work

Hi! I tried Székesfehérvár as a station but it doesn't work. If "unavailable" is displayed in the filter states line. I tried several other cities, they work.
Thanks!

can't add custom card

reported error in script:

ButtonCardJSTemplateError: TypeError: states['sensor.radioactivity_hu'] is undefined in 'var r_val = states['sensor.radioactivity_hu'].state; if ( r_val > 500 ) { return "red"; } ...'

Filter out inactive stations

The RAD.json has a field active for each station. This field is true only when the station has valid measurement data.

In this moment for example, station ID 103 has the active field set to false:
kép
The station shows invalid meaurement data: the measured value is errorneously 329000 (and moreover, during the night it had a peak of 2.8 million) which means we all would be dead by now :D

This is important for the case when station parameter is not set in the configuration, the errorneous station with extreme values will always be shown as alerting.

Inactive stations are filtered out from the official webpage too (inactive stations are not shown in the list):
https://www.katasztrofavedelem.hu/modules/hattersugarzas/aktualis_adatsor

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.