Skip to content

Commit

Permalink
Merge pull request #6 from frimtec/feature/wind-sensor-as-km-per-hour
Browse files Browse the repository at this point in the history
Report wind speed in km/h
  • Loading branch information
frimtec authored Jan 5, 2024
2 parents 6528a06 + 0cbf195 commit 2fb8687
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ as follows:


[file]: /esphome/frimtec-awning-sensors.yaml
[maintenance-shield]: https://img.shields.io/maintenance/yes/2023.svg
[maintenance-shield]: https://img.shields.io/maintenance/yes/2024.svg
[license-shield]: https://img.shields.io/github/license/frimtec/home-assistant-awning.svg
[license]: https://opensource.org/licenses/Apache-2.0
[nexentro-documentation]: https://cdn.competec.ch/documents2/4/5/5/194267554/194267554.pdf
Expand Down
33 changes: 31 additions & 2 deletions esphome/frimtec-awning-sensors.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
# Frimtec awning sensors.
#
# Sensors to control the awning for a winter garden:
# - Wind speed
# - Wind speed [km/h]
# - Sun light
#
substitutions:
device_name: frimtec-awning-sensors
friendly_name: "Awning Sensor"
device_description: "Sensors to control an awning"
project_version: "1.2.1"
project_version: "1.3.0"
wind_pulse_pin: GPIO13
sun_light_pin: GPIO32
status_led: GPIO5
Expand Down Expand Up @@ -110,6 +110,29 @@ text_sensor:
name: '${friendly_name} - Connected SSID'
icon: mdi:wifi-strength-2

number:
# Set the number of pulses of one anemometer rotation
- platform: template
id: anemometer_pulses
name: 'Anemometer pulses per rotation'
optimistic: true
min_value: 1
max_value: 100
step: 1
restore_value: yes
initial_value: 1

# Set the radius of the cup anemometer [mm]
- platform: template
id: anemometer_radius
name: 'Anemometer radius [mm]'
optimistic: true
min_value: 1
max_value: 500
step: 1
restore_value: yes
initial_value: 38

sensor:
# WiFi signal
- platform: wifi_signal
Expand All @@ -119,9 +142,15 @@ sensor:
- platform: pulse_counter
name: '${friendly_name} - Wind speed'
update_interval: 10s
force_update: true
device_class: wind_speed
unit_of_measurement: km/h
state_class: measurement
icon: mdi:weather-windy
pin: ${wind_pulse_pin}
filters:
# multiply value = (2 * pi * anemometer_radius * 60) / (anemometer_pulses * 1000000)
- lambda: return x * ((id(anemometer_radius).state * 37.699111843) / (id(anemometer_pulses).state * 100000.0));

- platform: adc
id: sun_light
Expand Down

0 comments on commit 2fb8687

Please sign in to comment.