Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rotate North. Keep arrow up. Optional secondary arrow. #155

Open
alnavasa opened this issue Mar 9, 2021 · 15 comments
Open

Rotate North. Keep arrow up. Optional secondary arrow. #155

alnavasa opened this issue Mar 9, 2021 · 15 comments
Assignees
Labels
config how-to Help on how to config the card enhancement New feature or request
Milestone

Comments

@alnavasa
Copy link

alnavasa commented Mar 9, 2021

Is your feature request related to a problem? Please describe.
Used as a compass for a car, boat, or any moving vehicle.

Describe the solution you'd like
I would like to have a arrow pointing up, instead of the north, a north rotating, and if possible a second arrow pointing to the wind

Describe alternatives you've considered
I have tried to mess with the offset option, but couldn't make it work. Offset only allows values, not sensors, and I am neither sure if this would fix it.

Additional context
I have a wind direction sensor, a boat course, and a boat speed sensor, three sensors.
I would like to have it behave (Not look) like the two following:

Captura de pantalla 2021-03-09 a las 21 01 55

Captura de pantalla 2021-03-09 a las 21 02 20

Or if possible like this (arrow up, wind arrow, north rotating):

Captura de pantalla 2021-03-09 a las 21 02 35

@tomvanswam tomvanswam added config how-to Help on how to config the card enhancement New feature or request labels Mar 10, 2021
@tomvanswam tomvanswam self-assigned this Mar 10, 2021
@tomvanswam tomvanswam added this to the v1.2.0 milestone Mar 10, 2021
@tomvanswam
Copy link
Owner

What an excellent idea! Thanks for taking the time to help make this card even better.

You're right, the N indicator can not be made dynamic with a sensor. I'll add this, and add E, S and W indicators as well.

Multiple arrows are already possible. I'll whip up an example and post it here.

@tomvanswam
Copy link
Owner

A kind of similar thing you ask for is possible, see the bottom right compass-card:
image
The top right compass card shows the raw wind and heading angles.
Only thing that is not possible like this is to show the N as north indicator, that's why I configured it as outward arrow.

To get this you need 2 template sensors, which calculate the north and wind direction angle in relation to your heading.

sensor:
  - platform: template
      calculated_north:
        friendly_name: "Calculated North"
        unit_of_measurement: "°"
        icon_template: "mdi:compass-outline"
        value_template: "{{ 360 - (states('input_number.heading') | float) }}"
      calculated_wind_direction:
        friendly_name: "Calculated Wind Direction"
        unit_of_measurement: "°"
        icon_template: "mdi:compass-outline"
        value_template: "{{ (states('input_number.wind_direction') | float) - (states('input_number.heading') | float) }}"

Use these sensors to populate the compass-card as such:

type: 'custom:compass-card'
indicator_sensors:
  - sensor: sensor.calculated_north
    state_abbreviation:
      show: false
  - sensor: sensor.calculated_wind_direction
    indicator:
      type: inward
  - sensor: input_number.heading
    state_abbreviation:
      show: true
    state_value:
      show: true
    state_units:
      show: true
    indicator:
      show: false

Hope this will do until I get the N indicator also dynamic.

@alnavasa
Copy link
Author

TOM! Thanks for considering the feature,
I am not in a hurry, so I'll wait until v1.2
Thanks a lot!

@tomvanswam
Copy link
Owner

In v1.2.0 the background and e/s/w indicators are added. The dynamic N (and the other new ones ofc) will have to wait till v1.3.0

@tomvanswam tomvanswam modified the milestones: v1.2.0, v1.3.0 Apr 21, 2021
@alnavasa
Copy link
Author

Don't worry tom!
I'll try it, but looking forward for 1.3.0,
I am a fan of your work!
Thanks

@tomvanswam tomvanswam modified the milestones: v1.5.0, v2.0.0 Apr 13, 2022
@Psytoshgen
Copy link

Hi!
Can I take a little of your time? To not make new thread. Can you make offset option more friendly with direction?
Now it's looks like picture (my windows facing to south)
12345676

@Psytoshgen
Copy link

Is your feature request related to a problem? Please describe. Used as a compass for a car, boat, or any moving vehicle.

Describe the solution you'd like I would like to have a arrow pointing up, instead of the north, a north rotating, and if possible a second arrow pointing to the wind

Describe alternatives you've considered I have tried to mess with the offset option, but couldn't make it work. Offset only allows values, not sensors, and I am neither sure if this would fix it.

Additional context I have a wind direction sensor, a boat course, and a boat speed sensor, three sensors. I would like to have it behave (Not look) like the two following:

Captura de pantalla 2021-03-09 a las 21 01 55 Captura de pantalla 2021-03-09 a las 21 02 20

Or if possible like this (arrow up, wind arrow, north rotating):

Captura de pantalla 2021-03-09 a las 21 02 35

ah yes, maybe it's easy-to-use flexible horseshoe card integration to make last compas?

@tomvanswam
Copy link
Owner

Hi! Can I take a little of your time? To not make new thread. Can you make offset option more friendly with direction? Now it's looks like picture (my windows facing to south)

Good point! Looks like a lazy implementation from my side ;-)

@lensherm
Copy link

lensherm commented Jun 23, 2022

@tomvanswam, firstly thanks for great work.

Just so I don't go down a rabbit hole someone's been to already, does using a template for a calculated offset to dynamically smoothly rotate the entire circle currently work?

@tomvanswam
Copy link
Owner

Unfortunately not het, thanks for asking and reminding me ;-)

@tomerddd
Copy link

tomerddd commented May 7, 2023

Heya! Wonder if you ever got to dynamic rotation (for boat heading)

Thanks for your efforts - love your work!

@tomvanswam
Copy link
Owner

I'm halfway there, but time is slipping through my fingers lately.

@Next9999
Copy link

i also look forward to have that nice feature :-)

1

@Rust-Shch
Copy link

Hello! Sorry for may be stupid question, but how to include second stnsor into the compass? I want wind direction (arrow inward) and sun (when above horizon), with values of wind speed and azimuth, and house outline behind. So far I managed only wind and wind speed.
Thank you in advance and for the awesome instrument!

@tomvanswam
Copy link
Owner

tomvanswam commented Sep 13, 2023

Hello! Sorry for may be stupid question, but how to include second stnsor into the compass? I want wind direction (arrow inward) and sun (when above horizon), with values of wind speed and azimuth, and house outline behind. So far I managed only wind and wind speed. Thank you in advance and for the awesome instrument!

With a config something like this

type: 'custom:compass-card'
indicator_sensors:
  - sensor: sensor.wind_direction
    indicator:
      type: inward
  - sensor: sensor.sun_angle
    indicator:
      type: circle
value_sensors:
  - sensor: sensor.wind_speed
  - sensor: sensor.wind_sazimuth
compass:
  circle:
    background_image: /local/compass-card/house.png
    background_opacity: 0.5

See example in the readme

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
config how-to Help on how to config the card enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

7 participants