Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pollen.com component instead of REST sensor #129

Closed
brianjking opened this issue Feb 12, 2018 · 1 comment
Closed

Pollen.com component instead of REST sensor #129

brianjking opened this issue Feb 12, 2018 · 1 comment

Comments

@brianjking
Copy link
Owner

@brianjking
Copy link
Owner Author

- platform: rest
  name: pollen
  resource: https://www.pollen.com/api/forecast/current/pollen/60640
  value_template: "{{value_json.Location.periods[1].Index}}"
  scan_interval: 21600
  headers:
    Referer: "https://www.pollen.com"

- platform: rest
  name: cold_flu
  resource: https://www.pollen.com/api/forecast/extended/cold/60640
  value_template: "{{value_json.Location.periods[0].Index}}"
  scan_interval: 21600
  headers:
    Referer: "https://www.pollen.com"      

    pollen_level:
        friendly_name: 'Pollen Level'
        value_template: >-
          {%- if states.sensor.pollen.state|float <= 2.4 %}
              Low
          {%- elif states.sensor.pollen.state|float <= 4.8 %}
              Medium-Low
          {%- elif states.sensor.pollen.state|float <= 7.2 %}
              Medium
          {%- elif states.sensor.pollen.state|float <= 9.6 %}
              Medium-High
          {%- elif states.sensor.pollen.state|float <= 12.0 %}
              High
          {% else %}
              Unknown
          {%- endif %}
    cold_flu_risk:
        friendly_name: 'Cold & Flu Risk'
        value_template: >-
          {%- if states.sensor.cold_flu.state|float <= 2.4 %}
              Low
          {%- elif states.sensor.cold_flu.state|float <= 4.8 %}
              Medium-Low
          {%- elif states.sensor.cold_flu.state|float <= 7.2 %}
              Medium
          {%- elif states.sensor.cold_flu.state|float <= 9.6 %}
              Medium-High
          {%- elif states.sensor.cold_flu.state|float <= 12.0 %}
              High
          {% else %}
              Unknown
          {%- endif %}

brianjking added a commit that referenced this issue Feb 14, 2018
brianjking added a commit that referenced this issue Feb 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant