Open sethhere04 opened 2 years ago
@sethhere04 I don't have any of these devices so unfortunately I can't add them. If you are willing to share your account (or create a new one) with me I could take a look.
Sorry, its not a separate device. It’s just the soil moisture % reported in the bhyve app. I was wondering if there is a way to see that in HA.
I came here to ask the exact same question!
Got it, will take a look and see what I can do!
Hey @sebr, not sure if this is helpful, but moisture is part of the landscape object which you can get with the get_landscape() function. You need to calculate it, percentage = available_water / (field_capacity_depth - replenishment_point) * 100
+1 on this feature.
+1
@allistermaguire Hi, I tried to implement the soil moisture sensor in this integration. But there's something wrong with the bhyve API or the way I calculate the moisture value:
import asyncio
import aiohttp
import pybhyve
async def async_update_callback(data):
pass
async def main() -> None:
"""Main."""
websession = aiohttp.ClientSession()
client = pybhyve.Client(
"login",
"passwd",
session=websession,
)
if await client.login() is False:
raise Exception()
loop = asyncio.get_event_loop()
client.listen(loop, async_update_callback)
all_devices = await client.devices
for device in all_devices:
device_id = device["id"]
for zone in device['zones']:
zone_id = zone["station"]
res = await client.get_landscape(zone_id=zone_id, device_id=device_id, force_update=True)
percentage = res["available_water"] / (res["field_capacity_depth"] - res["replenishment_point"]) * 100
print(percentage)
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
I have 5 zones and all the 5 moisture values were the same 47%, but the Android app shows meaningful moisture values. Do you have any idea how the app calculates these values?
Hi @kdeyev, I have had a look and I was mistaken, I assumed 'available_water' could be used to retrieve level as well as set it, but that is not the case.
Looking at it more from what I can capture from the app, it looks like it is calculated from the 'watering_plan' returned from api.orbitbhyve.com/v1/sprinkler_timer_programs.
When I get some time I will see if I can work it out.
+1 in a sensor that shows the moisture level and also a way to be able to adjust it.
@SetMonkey13 you can already adjust the moisture level with a service call to bhyve.set_smart_watering_soil_moisture
, have a look at the readme.
@SetMonkey13 you can already adjust the moisture level with a service call to
bhyve.set_smart_watering_soil_moisture
, have a look at the readme.
Seems like it doesn't work for me. I tired enabling and disable the rain delay via those service calls, but doing the 'bhyve.set_smart_watering_soil_moisture' doesn't change the soil moisture. using the 21004 with the gen 1 hub.
Is it possible to add the soil moisture % as a sensor reported to HA?