sebr / bhyve-home-assistant

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

Getting unknown for next watering sensor #200

Closed mash2k3 closed 3 months ago

mash2k3 commented 1 year ago

Describe the bug I get unknown state for the sensors next watering and delay finished

Expected behaviour get a timestamp for both sensors

BHyve devices HT25 Wifi hub gen 1

I downloaded bhyve_next_watering.py and moved it to \config\python_scripts

Added python_script: to config.yaml

called service service: python_script.bhyve_next_watering data: entity_id: switch.frontyard_zone

It created the 2 sensors but the states are unknown

mash2k3 commented 1 year ago

Did a workaround by using api and editing switch.py script from integration I added it as a attribute to the switch image I added these lines below, if there is any interest and no issues while testing i can do a PR.

ATTR_NEXT_START_TIME = "next_start_time" next_runtime = orbit_time_to_local_time( status.get("next_start_time") ).isoformat() if not is_watering: self._attrs.update( { ATTR_NEXT_START_TIME: next_runtime, } )

sebr commented 1 year ago

PR would be great, thanks @mash2k3.

sebr commented 3 months ago

I am no longer supporting these scripts

jhemak commented 3 months ago

Hi @mash2k3 - with your change mentioned above, are you seeing the correct value for next start time? Are you using Smart Watering or manual programs? See my issue #245 ... I am wondering if your change above would fix this?