GithubHelp home page GithubHelp logo

rianadon / opensprinkler-card Goto Github PK

View Code? Open in Web Editor NEW
62.0 3.0 7.0 435 KB

Home Assistant card for collecting OpenSprinkler status

License: Other

JavaScript 3.83% TypeScript 96.17%
home-assistant lovelace lovelace-ui opensprinkler

opensprinkler-card's Issues

No drop down available to choose device

I have multiple controllers, and when I add a new card, nothing happens when I click on "Required options".

I don't mind editing/working with YAML, can you provide a way to locate the device ID for inserting manually, please?

Station Icons

Wanted to open this for discussion. I have custom icons for my stations but it is not shown as this card uses hardcoded icons. My suggestion is to respect the station icons set on the station entities and use the colour to indicate whether it is running or not, kinda like how light entities work (not sure if possible).

Note the default station has different icons for running/idle but I don't think its possible to use custom icons for two different states through the entity configuration

Feature request: remove the 3 dots showing history

Not sure if this is a HA specific thing, but I'd love to have the 3 dots that shows the station history be a configurable boolean entry.

Why?

  1. I fat finger it all the time!!! (OK, that's probably a personal issue of mine!! hehe)
  2. My wife doesn't need to have more buttons to push that she needs to. It only leads to more questions (OK, this is probably another personal issue!!)

Thanks for your effort. People like you make the whole HA what it is!!

Proposal: Show Rain Delay status on the top-level card

๐Ÿ‘‹ Hi! New to OpenSprinkler, the HACS integration, and this Lovelace card...

At the moment I'm not yet comfortable with how the automatic weather handling algorithms might interact with new seeds in my garden, so I'm managing weather manually with the OpenSprinkler rain delay functionality.

I want to propose the idea of showing the rain delay status on the top-level card while active... similar to the brief banner across the top that you see on the OpenSprinkler home page or mobile app.

I've got a prototype that comes out looking like this... but before I pitch that as a PR, wanted to get your reaction as to whether that's a direction you would be interested in going or not:
image

Thoughts?

Basically looking to extend the high-level view of what's happening with my OpenSprinkler to also include "nothing... because there's a rain delay."

I'm interested in how to actually update the rain delay from Home Assistant as well, but need to dig into whether that's exposed by the API and integration or not. If so, perhaps it can be exposed through the card similar to the manual station time with the input_number support.

Manually start program if disabled

I would like to be able to start my program(s) manually even if they are disabled. Currently the "Play button" is greyed out and I have to enable the program first using the switch.

As far as I understand, it is possible to call the opensprinkler.run service even if the program is disabled to start the program once manually.

Any thoughts or reasons why this is not working? Am I missing something?

type: custom:opensprinkler-card
device: 60a146f0e7cae794128d151fc69e362e
name: Rasensprenger
extra_entities:
  - switch.dr_opensprinkler_kurz_program_enabled
  - binary_sensor.dr_opensprinkler_kurz_program_running
input_number:
  entity: input_number.dr_opensprinkler_dauer
  name: Dauer

"Play" greyed out:

grafik

"Play" working only when switch enabled:

grafik

Supporting additional parameters of numberbox-card

Amazing update in v1.6!!

I tried to make my card a little more colorful by using additional parameters from the numberbox-card. So my code editor now shows:

device: <device_id>
name: Sprinklers
hide_disabled: true
bars:
  bar_foreground: green
  icon: hass:sprinkler
  active_icon: hass:sprinkler-variant
input_number:
  entity: input_number.slider
  type: custom:numberbox-card
  unit: m
  icon: mdi:timelapse
  **icon_plus: mdi:chevron-up
  icon_minus: mdi:chevron-down**
extra_entities:
  - Zones
  - sensor.curb_station_status
  - sensor.front_yard_station_status
  - sensor.side_yard_station_status
  - sensor.s_flower_bed_station_status

I took these parameters from the numberbox-card README.md (see the section entitled Examples) where it shows the following (relevant part of the) code:

    type: 'custom:numberbox-card'
    icon_plus: 'mdi:chevron-up'
    icon_minus: 'mdi:chevron-down'
    style: |
      .cur-num{font-size:25px !important}
      .cur-unit{color:orange; font-size:100% !important; opacity:1 !important}
      .grid-left{color:red}
      .grid-right{color:blue}

However, the opensprinkler-card doesn't seem to want to honor the icon_plus or icon_minus parameters. See my screenshot below:
image

I need a little more time, but I can't wait to style the card further, using your timer-bar-card integration.

Duplicate station names not handled correctly

I have two OpenSprinkler controllers - one for the front yard and one for the backyard. There are multiple stations defined for each - 3 and 4, respectively. The remaining stations ("S0x") are unused.

I added both controllers to Home Assistant. There were no problems with the first one (front). However, when I added the second one (back), I only saw two stations instead of eight. I figured out that I only saw the two stations with unique names. The stations with names that were also present in "back" (including all the unused "S0x") were not visible.

I renamed the two stations I cared about, giving them unique names, removed and re-added the controller and the renamed stations are visible now. This makes me think that in a system with multiple sprinkler controllers, duplicate names are not handled properly.

The two controllers have unique names:
os

The entities have unique names as well:
stations

The "front" sprinkler card shows all stations, including the unused ones:
front

The "back" sprinkler card only shows the station with unique names:
back

Might it be a display issue?

Remove disabled entities

Hi! Thank you for an amazing card.
I have an 8 station setup, but some of the stations are not setup, so I have disabled them in Home Assistant. However, when I click the 3 dots .. I still see them. Is it possible to remove them? Or at least have a switch to control if they should be displayed on not please? Thanks again ...

image

OpenSprinkler Enable in extra_entities

When switch.opensprinkler_enabled is included in extra_entities it doesn't affect the entity status:

  1. When switch.opensprinkler_enabled is on, clicking the "stop" icon results in a spinning icon and the entity not turning off
  2. When switch.opensprinkler_enabled is off, the "play" icon is grayed out not clickable

I think ideally, when switch entity is included in extra_entities it would be nice for a toggle switch to be available or else having the icons correctly changing the state.

Thanks.

Duration timer bar displays incorrect time when station has started

Just added the card and setup extra_entities to allow ease of starting stations from my phone etc.

Issue is when I start a station with a duration of 1 minute, it shows a durtaion of 5:32. The station only runs for the set time of 1 minute.

What ever I increase the timer by, increases it by that same amout in the duration (appears it adds 4:32 to the actually run time display)

input_number not working

I'm not sure if this is a opensprinkler-card issue or a numberbox-card issue.
I have the following opensprinkler-card config:

type: custom:opensprinkler-card
device: abcdefghijklmnopqrstuvwxyz
name: Sprinklers
hide_disabled: true
bars:
  bar_foreground: green
  icon: hass:sprinkler
  active_icon: hass:sprinkler-variant
input_number:
  entity: input_number.slider
  type: custom:numberbox-card
  unit: m
  icon: mdi:timelapse
card_stations:
  - sensor.curb_station_status
  - sensor.front_yard_station_status
  - sensor.side_yard_station_status
  - sensor.s_flower_bed_station_status

For input_number, I have the following in configuration.yaml
input_number: !include input_numbers.yaml
In input_numbers.yaml I have the following:

slider:
  name: Watering Duration
  initial: 15 # in minutes
  min: 0
  max: 30
  step: 5
  # You can also use mode: box

But when I click the run button (right arrow), I see only 1m on the runtime:
image

My apologies if this is not an opensprinkler-card issue.

wrong place for this but i cant figure out..

wasting too much time trying to figure out how to msg you of some sort on github

would like to ask for a refresher in how to go about forking your os-app to my github and using my url for my opensprinkler.

also i have an extremely large homeassistant setup, and appreciate your cards

finally, if at all possible, in opensprinkler software on my pc, when i click a cog on a station, the popup window is just too small for my liking. wishing to do the above for my github fork, where about i do that, or any other advice would be appreciated, ill delete or close this asap

Weird quirk when an entity is disabled

So, I think I've found them weirdest quirk. Since I only have 4 zones, but I have 8 relays, I wanted to disable the 4 that are unused. It's not about OpenSprinkler, but it's about HA. I just want to keep things clean.

But as soon as one of the entities is disabled, the OS-card doesn't display anymore. In fact, if you go into a dashboard and edit the various cards, it's not even there!

I thought it was user error. For me, 9/10x it is. So, I added another OS-card. At that point, OS-card complains that the device doesn't even exist.

After a lot of trial and error, I figured out that when even one entity is disabled, OS-card goes bye-bye. Even when you re-enable the device only a HA restart will be recognized by the card.

How to put card Title??

Maybe it's very simple but I've been unable to ser card title as the rest of the cards I'm using. Now it's a bit confusing because all the rest have a title but the new opensprinkler card... ?

Thanks in advance.

Master stations shall not be controllable

Hi!

Would it be possible to disable the control buttons for master stations in the card?
My 8th station is configured for the pump power supply and is, thus, a master station.
It gets activiated by other stations if there is a request for water.

In the OpenSprinkler App it is also NOT controllable.

When I click on the "start/play" button in the card, I get an error from the integration:

Logger: homeassistant.components.websocket_api.http.connection
Source: custom_components/opensprinkler/__init__.py:324
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 10:01:40 (2 occurrences)
Last logged: 10:05:30

[140258864195568] ('Error code: 48', 48)
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 185, in handle_call_service
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 1495, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1530, in _execute_service
    await handler.job.target(service_call)
  File "/config/custom_components/opensprinkler/__init__.py", line 104, in _async_send_run_command
    await hass.helpers.service.entity_service_call(
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 667, in entity_service_call
    future.result()  # pop exception if have
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 863, in async_request_call
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 704, in _handle_entity_call
    await result
  File "/config/custom_components/opensprinkler/__init__.py", line 324, in run
    await self._station.run(run_seconds)
  File "/usr/local/lib/python3.9/site-packages/pyopensprinkler/station.py", line 81, in run
    return await self._manual_run(params)
  File "/usr/local/lib/python3.9/site-packages/pyopensprinkler/station.py", line 40, in _manual_run
    content = await self._controller.request("/cm", params)
  File "/usr/local/lib/python3.9/site-packages/pyopensprinkler/__init__.py", line 145, in request
    content = await self._request_http(url)
  File "/usr/local/lib/python3.9/site-packages/backoff/_async.py", line 133, in retry
    ret = await target(*args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/pyopensprinkler/__init__.py", line 200, in _request_http
    raise OpenSprinklerApiError(
pyopensprinkler.OpenSprinklerApiError: ('Error code: 48', 48)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.