Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Automated process from jupyter to production? #408

Unanswered
bjornbak asked this question in Q&A
Discussion options

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?

You must be logged in to vote

Replies: 0 comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant

AltStyle によって変換されたページ (->オリジナル) /