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

Output artifacts when input value becomes unavailable #30

Open
lukepighetti opened this issue Oct 18, 2022 · 7 comments
Open

Output artifacts when input value becomes unavailable #30

lukepighetti opened this issue Oct 18, 2022 · 7 comments

Comments

@lukepighetti
Copy link

lukepighetti commented Oct 18, 2022

If an input value becomes unavailable, ha-pid-controller defaults to 100% output. It would be nice to either handle this in ha-pid-controller or provide documentation for how to filter these values

Screen Shot 2022-10-18 at 12 19 27 PM

Screen Shot 2022-10-18 at 12 19 47 PM

@soloam
Copy link
Owner

soloam commented Oct 18, 2022

You can filter all the values with templates! All the fields can handle templating. You could do this, but I agree that the controller should handle this.

Tks

@lukepighetti
Copy link
Author

How would one do that with a template? Is there some way to use previous?

@soloam
Copy link
Owner

soloam commented Oct 18, 2022

You could turn off the pid if the variable of the input is unavailable.

But I agree that the pid should handle this! I'll put it on my to-do list.

@lukepighetti
Copy link
Author

This really throws a wrench in things. Would be nice to put together some docs real quick to address this.
IMG_E9C56D23D07A-1

@lukepighetti
Copy link
Author

lukepighetti commented Oct 18, 2022

Something that might help other folks, if you're using ESPHome, you can filter out nan values like so. Will have to wait to see if it resolves the issue for me

esphome:
  name: woodstove

# ...

sensor:
  - platform: max6675
    # ...
    filters:
      filter_out: nan

@lukepighetti
Copy link
Author

lukepighetti commented Oct 19, 2022

Did a little digging around

select state_id, entity_id, state, last_updated from states where entity_id = "sensor.woodstove_flue_temperature" and last_updated < "2022-10-19 00:18:30" order by last_updated desc limit 5;
3319880|sensor.woodstove_flue_temperature|221.0|2022-10-19 00:18:28.240829
3319874|sensor.woodstove_flue_temperature|220.6|2022-10-19 00:18:26.231467
3319796|sensor.woodstove_flue_temperature|222.8|2022-10-19 00:18:26.185954
3319709|sensor.woodstove_flue_temperature|unavailable|2022-10-19 00:18:25.030334
3319683|sensor.woodstove_flue_temperature|222.8|2022-10-19 00:17:18.227644

Screen Shot 2022-10-18 at 8 46 17 PM

Looks like that gap is when state is unavailable. This appears to be happening downstream of my ESP8266 sensor. I'm not sure how I could filter these values out before they go into ha-pid-controller

@lukepighetti
Copy link
Author

In the process of trying this out

  - platform: template
    sensors:
      woodstove_flue_temperature_filtered:
        friendly_name: "Woodstove Flue Temperature Filtered"
        unit_of_measurement: "°F"
        value_template: >
          {% if states('sensor.woodstove_flue_temperature') in ['unavailable', 'unknown', 'none'] %}
            {{ states('sensor.woodstove_flue_temperature_filtered') }}
          {% else %}
            {{ states('sensor.woodstove_flue_temperature') }}
            {% endif %}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants