Battery Seller - Review request and "how I can share it"?

Hello
So I wanted to create a Card / UI functionality, where I could sell power from my battery in X amount of time.
So I’ve created 3 Automations, 1 Script, 2 Helpers, to do this like this:
The overview:
image
code:
Card code

type: entities
entities:
  - entity: input_number.time_slider_sell
    name: Choose sell time
  - entity: script.start_sell_solar_cd_2
    name: Start battery selling
  - entity: timer.sell_solar_cd
    name: Selling time left
show_header_toggle: false
title: Battery seller

Script:

alias: Start Sell Solar Countdown
sequence:
  - data:
      entity_id: timer.sell_solar_cd
      duration: "{{ (states('input_number.time_slider_sell') | float * 60 * 60) | int }} "
    action: timer.start
  - action: notify.mobile_app_oneplus12anders
    data:
      message: >-
        Sell Solar Countdown started for {{
        states('input_number.time_slider_sell')}} hours.

timer (just made in configuration.yaml)

# for the solar
timer:
  sell_solar_cd:
    duration: "00:00:00"
  • a input_number (can’t find the yaml file or a like for that anywhere):
    image

The 3 Automations:

- id: '1724266308456'
  alias: Battery sell start
  description: Starts the solar selling of deye inverter
  trigger:
  - trigger: state
    entity_id:
    - timer.sell_solar_cd
    from:
    to: active
  condition:
  - condition: numeric_state
    entity_id: sensor.deyeinverter_sun12k_battery_capacity
    above: 45
    enabled: false
  action:
  - device_id: f216aefc5e28619ce8cb66ab2880b225
    domain: select
    entity_id: e42a6804ff4fc6c0dd7c8ee1ff852fcf
    type: select_option
    option: Selling first
  - action: notify.mobile_app_oneplus12anders
    metadata: {}
    data:
      title: Battery sell
      message: Battery sell started
  - action: notify.mobile_app_anna_s_mobil
    metadata: {}
    data:
      title: Battery sell
      message: Battery sell started
  mode: single
- id: '1725652598087'
  alias: Battery sell stop
  description: ''
  trigger:
  - trigger: state
    entity_id:
    - timer.sell_solar_cd
    from: active
    to: idle
  condition: []
  action:
  - device_id: f216aefc5e28619ce8cb66ab2880b225
    domain: select
    entity_id: e42a6804ff4fc6c0dd7c8ee1ff852fcf
    type: select_option
    option: Zero export to CT
  - action: notify.mobile_app_oneplus12anders
    metadata: {}
    data:
      title: Battery sell
      message: Battery sell has stopped
  - action: notify.mobile_app_anna_s_mobil
    metadata: {}
    data:
      title: Battery sell
      message: Battery sell has stopped
  mode: single
- id: '1725653373612'
  alias: Battery sell - Emergency stop
  description: Battery sell - Emergency stop
  triggers:
  - trigger: numeric_state
    entity_id:
    - sensor.deyeinverter_sun12k_battery_capacity
    below: 25
  conditions:
  - condition: state
    entity_id: select.deyeinverter_sun12k_limit_control_mode
    state: Selling first
  actions:
  - action: timer.cancel
    metadata: {}
    data: {}
    target:
      entity_id: timer.sell_solar_cd
  - device_id: f216aefc5e28619ce8cb66ab2880b225
    domain: select
    entity_id: e42a6804ff4fc6c0dd7c8ee1ff852fcf
    type: select_option
    option: Zero export to CT
  - action: notify.mobile_app_oneplus12anders
    metadata: {}
    data:
      title: Battery sell
      message: Battery sell stopped - battery too low
  - action: notify.mobile_app_anna_s_mobil
    metadata: {}
    data:
      title: Battery sell
      message: Battery sell - But already not selling
  mode: single

Now since I have this.
And my setup is made by a friend, I’d love that he could give this “component” to all his friends/clients, so they could easily sell aswell. But how do I make a blueprint or component or whatever that has all of this code?
I tried putting everything in 1 yaml file, but that made me have multiple “scripts” tags where only 1 is allowed… I’m kinda puzzled here.

Why would you sell battery power for x time? To who? What is the use case?

Hello Kruse, Thanks for replying, that is not really my question though.
But when i evaluate that i have enough power to last past high prices i some times want to sell.

Anything to add about how i do it or how i can share it?

Now I understand, I wish I had a setup to create power I could sell back!

In any event, the way to share it is to put the code and functionality into a Home Assistant blueprint. It looks like you’ll be reading up on how to create blueprints!

I have used a few but have not created any myself… I would suggest if it would be easier for you, to have your friend who wrote the code to help you or create the blueprint too

I wrote the code, he is just the hardware + find integration specialist :wink:
I just havn’t seen any way to incorporate scripts in blueprints, but I’ll have another look at them.
Thanks.
I’m really surprised at the low amount of feedback in here, have I written in the wrong category maybe?

Thjis forum is very active, I just find that the Categories and Tags seem pretty weak. It appears you got the most attention if you supply an intriguing or popular title for your post. (Don’t be misleading though, it will piss people off!) I have also found that posting a question that is overly complicated will turn people off, nobody wants to spend a long time trying to understand and answer someone else…