sebr / bhyve-home-assistant

Orbit BHyve custom component for Home Assistant
MIT License
251 stars 42 forks source link

Device showing weird history or none #241

Closed heffneil closed 4 months ago

heffneil commented 4 months ago

Describe the bug For some reason, I am not getting the watering history of my zone.

Expected behaviour I would like to know the number of gallons my tap timer dispenses. I did have this working with the current code.

BHyve devices

I have 1 - Smart Hose Tap Timer - it is for filling my pool daily. This is why the quantity of water is important

Device Diagnostics

I am using the following code:

config_entry-bhyve-8dc114621bd253dd065e536c686bda5a.json

  - sensor:
      - name: "Pool Fill Gallons Display"
        unit_of_measurement: 'gallons'  # Optional, for display purposes
        state: "{{ state_attr('sensor.pool_filler_zone_history', 'consumption_') }}"

The problem is pool_filler_zone_history isn't valid.

heffneil commented 4 months ago

Here is the output of the device in HA

Screenshot 2024-04-27 at 12 36 37 PM
heffneil commented 4 months ago
budget: 100
program: a
program_name: Fill Pool
run_time: 45
status: complete
consumption_gallons: null
consumption_litres: null
start_time: "2024-04-27T13:15:05.000Z"
device_class: timestamp
icon: mdi:history
friendly_name: Unknown zone history

I don't know why its named like this. I have removed the device and re-added it and it shows the same value. The consumption isn't recorded either.

sebr commented 4 months ago

The zone doesn't have a name, so it defaults to Unknown zone. The other entities fall back to the device name, but the zone history entity does not.

heffneil commented 4 months ago

I have named the zone as per your directions (I hadn't realized it wasn't named). Odd since it is a single zone but that's a orbit quirk.

The next question is why does it show the history as "unknown"?

Screenshot 2024-04-28 at 9 39 03 AM