I found this integration today and I was already thinking about automatic fans with heartbeats control.
Esp32 and pwm controller maybe the hw but I need to learn how to create it
I bought a cheap 3 speed floor fan, most of these come with 3-4 wire motors on them already with built in circuits to control motor speed based on 120V input to each wire, so you don’t need to use PWM. PWM will also typically cook AC motors.
I hooked up a SONOFF 4CH but you could use any 3+ relay ESP8266/32 board out there for cheap.
I wrote a small custom output for ESPHome and included that. Links to my code below. Critical is just having the appropriate interlocks configured at a minimum. the other code helps manage a dimmable light and ensures that all of it is exposed as a multi speed fan element inside of HA rather than a set of relays.
There should be nothing else Zwift related installed on the server but this integration. Is this integration doing 12,000+ DNS queries per day?
I installed AdGuard on the server and uncovered us-or-rly101.zwift.com being the top query by far. I don’t think there are any ill effects, so just curious.
theoretically, yes, this does not seem like a high number of queries, which shouldn’t really be that impactful as Adguard should be caching those responses. The default offline update interval is 15 seconds- so even if you weren’t online in a given day, you should expect to see about 5,700 queries. If you are online, we are checking the API every 2 seconds (though the integration will back off a quarter second at a time if it is throttled, so it could be slightly less frequent) and making multiple calls.
Thanks the RGB light idea. I have an underutilised RGB shelf light that’s about to see a lot of red with me.
Here is my automation that every few minutes checks watts and either turns AC cooling on high or fan only on low based on the criteria. Once Zwift goes offline, AC turns off.
There is a dumb fan that’s always on in front of me so this automation supplements the flow and cooling needs accordingly.
Hello,
try like this :
{{((states.sensor.zwift_online_5835990.attributes.latest_activity.distanceInMeters | int / 1000) / (states.sensor.zwift_online_5835990.attributes.latest_activity.movingTimeInMs | int / 3600000)) | round (2) }}
Thank you that solves it the original way I wanted too…
I did have a workaround for my lack finding a solution by implementing it as a statistic
- platform: statistics
name: "Zwift Online 24118 Average Heart Rate"
entity_id: sensor.zwift_heart_rate_24118
state_characteristic: mean
max_age:
hours: 24
precision: 0
Which I still use to display Avg HR - only catch is it only to shows the last 24 hours, so if you haven’t ridden in 24 hours the entity goes to “Unknown”
I love this component, and everything works fine. But for some reasons the integration is sometimes not connected to zwift, and i have to restart homeassistant to get it work. is it possible just to restart the integration?
Now the integration is also random disconnected during a workout…
2024-07-25 17:39:47.451 WARNING (MainThread) [homeassistant.util.loop] Detected blocking call to import_module with args (‘google._upb._message’,) inside the event loop by custom integration ‘zwift’ at custom_components/zwift/zwift_patch/zwift_messages_pb2.py, line 5: from google.protobuf import descriptor as _descriptor (offender: /usr/local/lib/python3.12/site-packages/google/protobuf/internal/api_implementation.py, line 41: mod = importlib.import_module(mod_name)), please report it to the author of the ‘zwift’ custom integration