Hi everyone! I’m currently exploring the best way to merge the values from two Fibaro wall plug sensors into one, where the most recent report is considered the most accurate. Here’s my thought process and some questions I have:
I have two Fibaro wall plugs, each reporting power usage independently. In Home Assistant, these appear as two separate sensors. My goal is to combine these values into a single sensor entity, where the most recently updated value takes precedence. This would give me a more accurate representation of the current power usage without having to manually check both sensors.
I’ve considered a few approaches:
- Using Automation: I could set up an automation that triggers whenever either sensor updates. The automation would then update a virtual sensor with the latest value. This seems feasible, but I’m not entirely sure how to implement it without causing performance issues.
- Custom Integration: Writing a custom integration to handle this might be overkill, but it would provide the most control. I’m not very experienced with Python, so this might be challenging.
- Using a Template Sensor: I could create a template sensor that references both sensors and somehow determines which one is more recent. However, I’m not sure how to compare timestamps in a template.
Has anyone successfully implemented something similar? I’d love to hear about your experiences and any tips or pitfalls to avoid. If this is a common use case, maybe there’s a more straightforward solution I’m missing!
Thanks for your insights!