Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 95468

Automation to fill in missing grafana values

$
0
0

@mvsjes2 wrote:

I’m trying to find a somewhat elegant way to force an update to my input_numbers once a minute so that there is data for grafana to plot. If I don’t do this and there has been no update for a while, the data series disappears from grafana until the next update occurs, which may be ages.

I’ve been trying in many different ways to have an array of entity_id’s for input_numbers to update, and have the automation run through them and set them to their current values. My latest attempt was:

- alias: Graph input numbers
  trigger:
    platform: time_pattern
    minutes: '/1'
  action:
    - service: input_number.set_state
      data_template:
        entity_id:
          - input_number.fr_target_co2
          - input_number.fr_target_humidity
          - input_number.fr_target_min_temp
          - input_number.fr_target_max_temp
          - input_number.fr_fan_time
          - input_number.fr_humidifier_time
          - input_number.fruiting_automation
        value: '{{ states(entity_id) }}'

But the value doesn’t resolve to an actual entity_id:

Error rendering data template: UndefinedError: 'entity_id' is undefined

I know that I can create a list of input_number.set_state for each entity, but I wanted to keep things less verbose and easier to follow. I even tried stashing the input_numbers in a group and processing the entity_ids from the group, but couldn’t figure it out. I’ve tried scripts but couldn’t get that to work either.

I was also hoping for a more generic solution so that I could pass input_booleans and possibly other compatible entities, but this more narrow solution would help for now.

Does someone have a suggestion on which way to go?

Posts: 7

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 95468

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>