sebr/bhyve-home-assistant

Getting unknown for next watering sensor

mash2k3 opened this issue · 4 comments

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

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

PR would be great, thanks @mash2k3.

sebr commented

I am no longer supporting these scripts

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?