-
Notifications
You must be signed in to change notification settings - Fork 58
-
Hi,
I love jupyter for creating, maintaining and debugging my HA scripts and templated sensors :)
I got some templated sensors that just get too verbose in jinja2.
So I created a jupyter notebook and proved I could create the same output including updating the already defined sensor... Perfect!
And I found you can use nbconvert to convert the notebook to Python - so far so good..
I could easily see my script nbconvert and upload to HA when ever I save the notebook or similar.
But I had to inject a
@state_trigger("sensor.energy_production_remaining or sensor.energi_data_service_buy or sensor.sonnen_battery_level_kwh or sensor.sonnen_hours_to_charge_window_end", state_check_now=True)
def update_sonnen_needed_charge_hours():
between from datetime import datetime
and my actually code.
This won't be the last time I update this script and don't like the idea of me having to copy the changes over manually..
How do everyone else keep your Notebook testbeds synchronized with code in production?
Beta Was this translation helpful? Give feedback.