Home Assistant : Q&A, Tips & Tricks, Your Configs

TedLasso

Expert Member
Joined
Feb 23, 2016
Messages
3,760
Try and change {{ trigger.trigger_id }} to {{ trigger.to_state.attributes.friendly_name }}.

It is how it is on my automations and works correctly.
Thx. Fricking hell - I think I am just not cut out for this. Updated my automation and will wait to see if I get magic message later.

Will update this post to confirm findings.

It works. I now understand how it needs to be constructed. Thanks @w1tw0lf
 
Last edited:

MidnightZA

Expert Member
Joined
Mar 9, 2013
Messages
2,452
Is there a issue with the Tuya integration? Mine stopped working this morning

I really need to switch to localtuya
 

MidnightZA

Expert Member
Joined
Mar 9, 2013
Messages
2,452
I've been using V2 (built into HA) for some months now - hasn't skipped a beat. Its now maintained by Frenck (?)

Isnt V2 added through hacs since its still in beta? I had that one but some sensors were missing so I switched to the one thats under the "add intergration" options
 

Mzezman

Expert Member
Joined
Nov 13, 2021
Messages
2,637
Isnt V2 added through hacs since its still in beta? I had that one but some sensors were missing so I switched to the one thats under the "add intergration" options
I think v2 got upgraded to Integrations and no longer has to be installed through hacs - that is the one i have been using
 

Tinuva

The Magician
Joined
Feb 10, 2005
Messages
12,478
Now that we have had some heat waves in Cape Town, can finally say I spent time to improve my temperature/weather/climate view.

Screenshot 2022-01-12 at 11.54.59.png

The hourly forecast for the outside temperature was the last piece I really wanted.

Temperature sensors auto sort by temperature and also show additional sensors I have there. Lastly the ACs are in there.

Very happy with the hourly forecast in the graph.
 

w1tw0lf

Expert Member
Joined
Sep 29, 2009
Messages
1,190
And I thought I am the only one with temperature monitors in each room, except bathrooms.... Just missing my own weather station for outside.
 

Tinuva

The Magician
Joined
Feb 10, 2005
Messages
12,478
And I thought I am the only one with temperature monitors in each room, except bathrooms.... Just missing my own weather station for outside.
Haha I thought the same!

That said, I do have some range and stability issues with my zigbee network, so some sensors become unavailable or just completely drop off. Have some ideas on how to fix it but it needs $$$ so takes time.
 

ItherNiT

Senior Member
Joined
Jan 31, 2011
Messages
962
What are those 2 cards?
How do you get the second or third field next to the temperature (humidity, etc)?

1641985474475.png
 

Tinuva

The Magician
Joined
Feb 10, 2005
Messages
12,478
What are those 2 cards?
How do you get the second or third field next to the temperature (humidity, etc)?

View attachment 1225708
The graph card is apexcharts card (<-- link).

As for having multiple items in a single row on the 2nd card, its a combination of addons.

1st is Auto Entities to allow sorting from top to bottom based on value. In my case the temperature.
2nd is Multiple Entity Row to get multiple fields in a single row. Each line is just a filter in the Auto Entities card.

Edit: Here is the code.

Graph card
Code:
type: custom:apexcharts-card
experimental:
  color_threshold: true
graph_span: 48h
span:
  start: day
  offset: '-14h'
now:
  show: true
  label: now
header:
  show: true
  title: Outside temperature
  show_states: true
  colorize_states: false
series:
  - entity: sensor.heat_index
    stroke_width: 2
    curve: smooth
    show:
      extremas: true
    extend_to_end: false
    group_by:
      func: avg
      duration: 30min
    color_threshold:
      - value: 37
        color: '#7e0001'
      - value: 35
        color: '#9a0000'
      - value: 32
        color: '#d80100'
      - value: 29
        color: '#fe0000'
      - value: 26
        color: '#f46523'
      - value: 24
        color: '#ff9e07'
      - value: 21
        color: '#ffd728'
      - value: 18
        color: '#ffff01'
      - value: 15
        color: '#cdff00'
      - value: 13
        color: '#80ff00'
      - value: 10
        color: '#3ab54a'
      - value: 7
        color: '#05f7f8'
      - value: 4
        color: '#00ccff'
      - value: 2
        color: '#017eff'
      - value: -1
        color: '#0000fe'
      - value: -4
        color: '#1b1464'
      - value: -7
        color: '#662e93'
  - entity: sensor.outside_temperature
    name: Temperature
    opacity: 0.5
    color: '#797D7F'
    stroke_width: 2
    unit: °C
    fill_raw: last
    extend_to_end: false
    group_by:
      func: avg
      duration: 30m
  - entity: weather.home_hourly
    name: Hourly forecast
    stroke_width: 2
    type: line
    extend_to_end: false
    unit: °C
    opacity: 0.7
    color_threshold:
      - value: 37
        color: '#7e0001'
      - value: 35
        color: '#9a0000'
      - value: 32
        color: '#d80100'
      - value: 29
        color: '#fe0000'
      - value: 26
        color: '#f46523'
      - value: 24
        color: '#ff9e07'
      - value: 21
        color: '#ffd728'
      - value: 18
        color: '#ffff01'
      - value: 15
        color: '#cdff00'
      - value: 13
        color: '#80ff00'
      - value: 10
        color: '#3ab54a'
      - value: 7
        color: '#05f7f8'
      - value: 4
        color: '#00ccff'
      - value: 2
        color: '#017eff'
      - value: -1
        color: '#0000fe'
      - value: -4
        color: '#1b1464'
      - value: -7
        color: '#662e93'
    show:
      in_header: false
    data_generator: >
      const res = entity.attributes.forecast.map((entry) => {
        return [new Date(entry.datetime).getTime(), entry.temperature];
      });

      return [[new Date().getTime(), parseFloat(entity.attributes.temperature)],
      ...res]

Temp card:
Code:
type: custom:auto-entities
show_empty: false
sort:
  method: state
  reverse: true
  numeric: true
card:
  type: entities
  title: Tempterature
  show_header_toggle: false
filter:
  exclude:
    - entity_id: '*gateway*'
    - entity_id: '*disk*'
    - entity_id: '*shelly*'
    - entity_id: '*goodwe*'
    - entity_id: '*mi_9t*'
    - entity_id: '*nokia*'
  include:
    - entity: sensor.outside_temperature
      type: custom:multiple-entity-row
      name: Outside
      state_header: Temp
      entities:
        - entity: sensor.heat_index
          name: Feels like
        - entity: sensor.outside_humidity
          name: Humidity
    - entity: sensor.office_temperature
      type: custom:multiple-entity-row
      name: Office
      state_header: Temp
      entities:
        - entity: sensor.office_humidity
          name: Humidity
    - entity: sensor.front_bathroom_temperature
      type: custom:multiple-entity-row
      name: Front Bathroom
      state_header: Temp
      entities:
        - entity: sensor.front_bathroom_humidity
          name: Humidity
    - entity: sensor.scullery_temperature
      type: custom:multiple-entity-row
      name: Scullery
      state_header: Temp
      entities:
        - entity: sensor.scullery_humidity
          name: Humidity
    - entity: sensor.baby_room_temperature
      type: custom:multiple-entity-row
      name: Baby Room
      state_header: Temp
      entities:
        - entity: sensor.baby_room_humidity
          name: Humidity
    - entity: sensor.main_bathroom_temperature
      type: custom:multiple-entity-row
      name: Main Bathroom
      state_header: Temp
      entities:
        - entity: sensor.main_bathroom_humidity
          name: Humidity
    - entity: sensor.main_bedroom_temperature
      type: custom:multiple-entity-row
      name: Main Bedroom
      state_header: Temp
      entities:
        - entity: sensor.main_bedroom_humidity
          name: Humidity
    - entity: sensor.lounge_temperature
      type: custom:multiple-entity-row
      name: Lounge
      state_header: Temp
      entities:
        - entity: sensor.lounge_humidity
          name: Humidity
    - entity: sensor.fridge_temperature
      type: custom:multiple-entity-row
      name: Fridge
      state_header: Temp
      entities:
        - entity: sensor.fridge_humidity
          name: Humidity
    - entity: sensor.poolsense_temperature
      type: custom:multiple-entity-row
      name: Pool
      state_header: Temp
 

ItherNiT

Senior Member
Joined
Jan 31, 2011
Messages
962
The graph card is apexcharts card (<-- link).

As for having multiple items in a single row on the 2nd card, its a combination of addons.

1st is Auto Entities to allow sorting from top to bottom based on value. In my case the temperature.
2nd is Multiple Entity Row to get multiple fields in a single row. Each line is just a filter in the Auto Entities card.

Edit: Here is the code.

Graph card
Code:
type: custom:apexcharts-card
experimental:
  color_threshold: true
graph_span: 48h
span:
  start: day
  offset: '-14h'
now:
  show: true
  label: now
header:
  show: true
  title: Outside temperature
  show_states: true
  colorize_states: false
series:
  - entity: sensor.heat_index
    stroke_width: 2
    curve: smooth
    show:
      extremas: true
    extend_to_end: false
    group_by:
      func: avg
      duration: 30min
    color_threshold:
      - value: 37
        color: '#7e0001'
      - value: 35
        color: '#9a0000'
      - value: 32
        color: '#d80100'
      - value: 29
        color: '#fe0000'
      - value: 26
        color: '#f46523'
      - value: 24
        color: '#ff9e07'
      - value: 21
        color: '#ffd728'
      - value: 18
        color: '#ffff01'
      - value: 15
        color: '#cdff00'
      - value: 13
        color: '#80ff00'
      - value: 10
        color: '#3ab54a'
      - value: 7
        color: '#05f7f8'
      - value: 4
        color: '#00ccff'
      - value: 2
        color: '#017eff'
      - value: -1
        color: '#0000fe'
      - value: -4
        color: '#1b1464'
      - value: -7
        color: '#662e93'
  - entity: sensor.outside_temperature
    name: Temperature
    opacity: 0.5
    color: '#797D7F'
    stroke_width: 2
    unit: °C
    fill_raw: last
    extend_to_end: false
    group_by:
      func: avg
      duration: 30m
  - entity: weather.home_hourly
    name: Hourly forecast
    stroke_width: 2
    type: line
    extend_to_end: false
    unit: °C
    opacity: 0.7
    color_threshold:
      - value: 37
        color: '#7e0001'
      - value: 35
        color: '#9a0000'
      - value: 32
        color: '#d80100'
      - value: 29
        color: '#fe0000'
      - value: 26
        color: '#f46523'
      - value: 24
        color: '#ff9e07'
      - value: 21
        color: '#ffd728'
      - value: 18
        color: '#ffff01'
      - value: 15
        color: '#cdff00'
      - value: 13
        color: '#80ff00'
      - value: 10
        color: '#3ab54a'
      - value: 7
        color: '#05f7f8'
      - value: 4
        color: '#00ccff'
      - value: 2
        color: '#017eff'
      - value: -1
        color: '#0000fe'
      - value: -4
        color: '#1b1464'
      - value: -7
        color: '#662e93'
    show:
      in_header: false
    data_generator: >
      const res = entity.attributes.forecast.map((entry) => {
        return [new Date(entry.datetime).getTime(), entry.temperature];
      });

      return [[new Date().getTime(), parseFloat(entity.attributes.temperature)],
      ...res]

Temp card:
Code:
type: custom:auto-entities
show_empty: false
sort:
  method: state
  reverse: true
  numeric: true
card:
  type: entities
  title: Tempterature
  show_header_toggle: false
filter:
  exclude:
    - entity_id: '*gateway*'
    - entity_id: '*disk*'
    - entity_id: '*shelly*'
    - entity_id: '*goodwe*'
    - entity_id: '*mi_9t*'
    - entity_id: '*nokia*'
  include:
    - entity: sensor.outside_temperature
      type: custom:multiple-entity-row
      name: Outside
      state_header: Temp
      entities:
        - entity: sensor.heat_index
          name: Feels like
        - entity: sensor.outside_humidity
          name: Humidity
    - entity: sensor.office_temperature
      type: custom:multiple-entity-row
      name: Office
      state_header: Temp
      entities:
        - entity: sensor.office_humidity
          name: Humidity
    - entity: sensor.front_bathroom_temperature
      type: custom:multiple-entity-row
      name: Front Bathroom
      state_header: Temp
      entities:
        - entity: sensor.front_bathroom_humidity
          name: Humidity
    - entity: sensor.scullery_temperature
      type: custom:multiple-entity-row
      name: Scullery
      state_header: Temp
      entities:
        - entity: sensor.scullery_humidity
          name: Humidity
    - entity: sensor.baby_room_temperature
      type: custom:multiple-entity-row
      name: Baby Room
      state_header: Temp
      entities:
        - entity: sensor.baby_room_humidity
          name: Humidity
    - entity: sensor.main_bathroom_temperature
      type: custom:multiple-entity-row
      name: Main Bathroom
      state_header: Temp
      entities:
        - entity: sensor.main_bathroom_humidity
          name: Humidity
    - entity: sensor.main_bedroom_temperature
      type: custom:multiple-entity-row
      name: Main Bedroom
      state_header: Temp
      entities:
        - entity: sensor.main_bedroom_humidity
          name: Humidity
    - entity: sensor.lounge_temperature
      type: custom:multiple-entity-row
      name: Lounge
      state_header: Temp
      entities:
        - entity: sensor.lounge_humidity
          name: Humidity
    - entity: sensor.fridge_temperature
      type: custom:multiple-entity-row
      name: Fridge
      state_header: Temp
      entities:
        - entity: sensor.fridge_humidity
          name: Humidity
    - entity: sensor.poolsense_temperature
      type: custom:multiple-entity-row
      name: Pool
      state_header: Temp

Will implement on my side tonight!

Thanks!
 

xrapidx

Honorary Master
Joined
Feb 16, 2007
Messages
40,311
Now that we have had some heat waves in Cape Town, can finally say I spent time to improve my temperature/weather/climate view.

View attachment 1225640

The hourly forecast for the outside temperature was the last piece I really wanted.

Temperature sensors auto sort by temperature and also show additional sensors I have there. Lastly the ACs are in there.

Very happy with the hourly forecast in the graph.
Looks good - thought it was Grafana initially, I'm working on the same - but taken a back seat until I get stable results from zigbee...

Also - it would look better if you fix the spelling mistake :D
 

Tinuva

The Magician
Joined
Feb 10, 2005
Messages
12,478
Looks good - thought it was Grafana initially, I'm working on the same - but taken a back seat until I get stable results from zigbee...

Also - it would look better if you fix the spelling mistake :D
Haha thanks! No idea how I missed it, but fixed now.

More a typing mistake I think.
 

Veroland

Executive Member
Joined
Aug 24, 2005
Messages
6,304
That said, I do have some range and stability issues with my zigbee network, so some sensors become unavailable or just completely drop off. Have some ideas on how to fix it but it needs $$$ so takes time.
Talking about the zigbee issues where devices drop off. I changed my setup to have 2 sonoff extenders sitting next to each other instead of about 6m apart as I used to, and I have not had a issue where devices drop off for a month now.
 
Top