Connecting Kyiv-based Live GGreg20_V3 Geiger counter sensor node to the Home Assistant via HTTP GET API.
GGreg20_V3 Geiger counter Hackaday project page: https://hackaday.io/project/183103-ggreg20v3-ionizing-radiation-detector
ThingSpeak Channel: https://thingspeak.com/channels/1749073
Order on Tindie: https://www.tindie.com/stores/iotdev/
This repository is for Home Assistant server users who want to add radiation data from the GGreg20_V3 demo module located in Kyiv, Ukraine, to their Home Assistant sensor list. This is a real module that continuously measures background radiation levels (excluding blackouts) and transmits them directly to ThingSpeak via the HTTP API.
To add the necessary entities, you need to edit the configuration.yaml file and create widgets. And that's it.
Here Home Assistant API is used: https://www.home-assistant.io/integrations/sensor.rest/
sensor:
- platform: rest
resource: https://api.thingspeak.com/channels/1749073/fields/1.json?results=1
name: ThingSpeakAPI Sensor CPM
state_class: measurement
value_template: "{{ int(value_json.feeds.0.field1) }}"
- platform: rest
resource: https://api.thingspeak.com/channels/1749073/fields/2.json?results=1
name: ThingSpeakAPI Sensor uSvperH
state_class: measurement
value_template: "{{ float(value_json.feeds.0.field2) }}"
- platform: rest
resource: https://api.thingspeak.com/channels/1749073/fields/3.json?results=1
name: ThingSpeakAPI Sensor dose usV
state_class: measurement
value_template: "{{ float(value_json.feeds.0.field3) }}"
After adding the sensors to the configuration and restarting the server, the following sensor entities will be available with data received from the ThingSpeak channel for the GGreg20_V3 Radiation Sensor Node.
To add a simple widget to the dashboard, just create an Entity-based card with the following settings in the form of code: Basic Widget Code:
type: entities
entities:
- entity: sensor.thingspeakapi_sensor_cpm
icon: mdi:pulse
name: ThingSpeakAPI Sensor CPM
- entity: sensor.thingspeakapi_sensor_usvperh
icon: mdi:radioactive
name: ThingSpeakAPI Sensor uSv/h
- entity: sensor.thingspeakapi_sensor_dose_usv
icon: mdi:radioactive
name: ThingSpeakAPI Sensor dose uSv
title: GGreg20_V3 Radiation (MA5)
However, to have beautiful and expressive widgets, you can use the unofficial HACS extension (installed in Home Assistant additionally, according to a separate procedure) and dashboard plugins such as custom-mini-card. If you already have these extensions installed, here's an example of how to set up widgets for them:
type: custom:mini-graph-card
icon: mdi:radioactive
entities:
- entity: sensor.thingspeakapi_sensor_usvperh
name: GGreg20_V3
name: GGreg20_V3 Sensor Node, uSv/h (24h)
hours_to_show: 24
show:
labels: true
color_thresholds:
- value: 0.2
color: '#28a745'
- value: 0.3
color: '#c0392b'
- value: 0.6
color: '#dc3545'
Hourly Wigdet with min / max / avg code:
type: custom:mini-graph-card
icon: mdi:radioactive
entities:
- entity: sensor.thingspeakapi_sensor_usvperh
aggregate_func: max
name: Max
color: null
- entity: sensor.thingspeakapi_sensor_usvperh
aggregate_func: min
name: Min
- entity: sensor.thingspeakapi_sensor_usvperh
aggregate_func: avg
name: Avg
color: green
name: GGreg20_V3 Radiation Power (Hourly)
hours_to_show: 24
points_per_hour: 12
group_by: hour
show:
labels: true
type: gauge
entity: sensor.thingspeakapi_sensor_usvperh
min: 0
max: 0.9
unit: uSv/h
name: GGreg20_V3 Sensor Node ThingSpeak
needle: true
severity:
green: 0
yellow: 0.3
red: 0.6