Discussion
Loading...

Discussion

  • About
  • Code of conduct
  • Privacy
  • Users
  • Instances
  • About Bonfire
Cassidy James :gg: :fh:
@cassidy@mastodon.blaede.family  ·  activity timestamp 3 weeks ago

Protip to make Home Assistant automations easier: use helpers instead of overcomplicating your automations!

I have a certain class of automation I've set up a few times now: I have a thing that uses power. It's plugged into a Zigbee plug that can measure energy usage. I want to know when the thing is running!

You can use a threshold sensor to make this 100× better…

#HomeAssistant

  • Copy link
  • Flag this post
  • Block
Cassidy James :gg: :fh:
@cassidy@mastodon.blaede.family replied  ·  activity timestamp 3 weeks ago

Before, I would set up an automation directly on the “Power” attribute, e.g. triggering if the wattage went above some threshold for a certain amount of time. And then I'd need to be clever about the wattage going back down.

Instead, I create a threshold sensor e.g. called “Running” for that same wattage. Home Assistant then helpfully adds that sensor to the parent device automatically—now you have a binary “running” entity! You can trivially show it in a dashboard, add it to automations, etc.

  • Copy link
  • Flag this comment
  • Block
Bojan Land
@bojanland@mastodon.social replied  ·  activity timestamp 3 weeks ago

@cassidy can you tet detect via gadgets if your toilet is clogged and automatically use an autonomous plunger?

  • Copy link
  • Flag this comment
  • Block
Cassidy James :gg: :fh:
@cassidy@mastodon.blaede.family replied  ·  activity timestamp 3 weeks ago

@bojanland don't tempt me with a good time! I have seen people add a contact sensor to the toilet lid to detect if it was left open… literal #InternetOfShit

  • Copy link
  • Flag this comment
  • Block
Bojan Land
@bojanland@mastodon.social replied  ·  activity timestamp 3 weeks ago

@cassidy well I was half serious because there are plenty of people who can not use the plunger themselves whether due to.disabilities or old age. Lots of such work to be done for Earth before we need rockets to Mars!

  • Copy link
  • Flag this comment
  • Block
Cassidy James :gg: :fh:
@cassidy@mastodon.blaede.family replied  ·  activity timestamp 3 weeks ago

Similarly, I was thinking about putting the estimated time the laundry would be done on a dashboard, but then realized I'd have to repeat that if I wanted it in more than one place, like a notification… so: template sensor!

I created a template sensor with some simple logic to add 33 mins (our typical cycle time) to the timestamp of when the “running” sensor last turned on. I added it to the device as well, and now I can reuse that ETA anywhere in Home Assistant.

  • Copy link
  • Flag this comment
  • Block
kaiserkiwi :kiwibird:
@kaiserkiwi@corteximplant.com replied  ·  activity timestamp 3 weeks ago

@cassidy Can you elaborate on this further? It won't work for my washing machine but probably on the dishwasher.

How exactly did you do that?

  • Copy link
  • Flag this comment
  • Block
Cassidy James :gg: :fh:
@cassidy@mastodon.blaede.family replied  ·  activity timestamp 3 weeks ago

@kaiserkiwi here is the literal helper, and then I can include this entity anywhere.

{% if is_state('binary_sensor.washing_machine', true) %}
  {{ states.binary_sensor.washing_machine.last_changed + timedelta(minutes = 33) }}
{% else %}
  {{ states.binary_sensor.washing_machine.last_changed }}
{% endif %}
{% if is_state('binary_sensor.washing_machine', true) %} {{ states.binary_sensor.washing_machine.last_changed + timedelta(minutes = 33) }} {% else %} {{ states.binary_sensor.washing_machine.last_changed }} {% endif %}
{% if is_state('binary_sensor.washing_machine', true) %} {{ states.binary_sensor.washing_machine.last_changed + timedelta(minutes = 33) }} {% else %} {{ states.binary_sensor.washing_machine.last_changed }} {% endif %}
  • Copy link
  • Flag this comment
  • Block
kaiserkiwi :kiwibird:
@kaiserkiwi@corteximplant.com replied  ·  activity timestamp 3 weeks ago

@cassidy Oh! That's smart!

We use two different programs so I need to track this to get the time, but as a guesstimate for the main program it's already pretty good. Thank you for that!

  • Copy link
  • Flag this comment
  • Block
Cassidy James :gg: :fh:
@cassidy@mastodon.blaede.family replied  ·  activity timestamp 3 weeks ago

Energy monitoring is one of my favorite ways to make dumb appliances smart: there’s no Internet connection or even network traffic if you stick to Zigbee (or Thread or Z-Wave, I suppose), but you can do genuinely useful things with it locally.

We have an announcement speaker that tells us when the laundry is done, plus if you look at the dashboard in the Home Assistant app, you can quickly see if the laundry is running and when it's expected to be done. With a 20-year-old washing machine!

  • Copy link
  • Flag this comment
  • Block
Log in

bonfire.cafe

A space for Bonfire maintainers and contributors to communicate

bonfire.cafe: About · Code of conduct · Privacy · Users · Instances
Bonfire social · 1.0.0-rc.3.21 no JS en
Automatic federation enabled
  • Explore
  • About
  • Members
  • Code of Conduct
Home
Login