Rewrite template from openHAB

Use the GUI to build your automation. You haven’t shared any information on what you expect it to do, so no one here can help. Also, you should try building it yourself first before you ask for help. Otherwise you’ll be relying on everyone else to do this for you in the future. And as you can see by the lack of responses, that isn’t sustainable.

When you get stuck with your automation, then ask questions.

I’m trying to implement a zero injection for my case, which can read the value from my smart meter and sends this offsetting calculation to the inverter via MQTT and adjusts the value. OpenDTU is able to read the inverter and regulate the power.

OpenDTU and Smartmeter are integrated in HA I only need a suitable template for control 

I have already explained my plan above. now, thanks to your help, i have been able to create the 3 sensors as specified by openHAB. However, I have tried countless times to create an automation that sends the limit to the inverter, but without success

back to my plan: a value should be read from a smart meter, which then independently recognizes how much electricity is being produced and automatically sets the value to 0. openDTU is able to regulate the power 10-100% for example 100% = 600 watts 50% = 300 watts. now i have the 3 sensors but i don’t know how to use them to realize a zero feed. the limit should regulate itself again and again with each new value

As I said, I am new to HA and am trying to understand it, and I would like to apologize for my countless questions

Post what you have tried please.

I tried it with the 3 sensors as a template trigger and for the last image I don’t know what to specify because I can’t select an entity.



Don’t use the device trigger, use a state trigger or numeric trigger and then select the entity. The yaml configuration I posted for the entities does not go in the trigger. You simply select the entity.

Also, when posting to the forums, convert the automation to yaml by viewing the item as yaml. I can’t read whatever language that is, but I can read the yaml.

- id: '16689xxxxxxxx'
  alias: Neues
  description: ''
  trigger:
  - platform: state
    entity_id:
    - sensor.new_limit
  condition:
  - condition: state
    entity_id: sensor.diff_power_to_limit
    state: ''
  - condition: state
    entity_id: sensor.limit_nonpersistent_relative
    state: ''
  action: []
  mode: single

But I don’t know whether it is necessary to integrate all 3 newly created sensors into the automation or whether they only have to be created in part so that individual sensors run in the ‘‘background’’

for me it would be logical if a smart meter recognizes new values ​​and then marks them as ‘‘triggers’’. and then the new sensor ‘‘New Limit’’ then send the new limit as ‘‘Action’’ …or am I wrong ?

But I don’t know how I can set the entity ‘‘new Limit’’ as ‘‘Action’’ because I can’t select a state or numeric state

You need to figure out what you want to do based on your sensor values. Are you only performing an action when a sensor.new_limit has a new value? If yes, that’s your trigger entity_id. To use it as data, you need to use a template inside a service calls data in the action section.

Automations work like this:

Trigger → check stuff, if stuff passes → run actions.

From what it sounds like, you don’t need to check anything, you just need to use the trigger’s value in your action. But you haven’t shared what you’re trying to execute yet. All your attempts have empty action sections.

I think my automation is missing the option that the value “new limit” is sent to the inverter via MQTT command. How do I get the new value to be routed via MQTT?

I think then my automation should work

there’s an MQTT publish service that allows you to send any data to a topic.

can you also specify a sensor as a payload? that I specify the inverter as a topic and the new limit is forwarded there?

is this configuration usable for this?

{{state_attr(‘device_tracker.paulus’, ‘battery’)}}

Yes the payload is templatable MQTT - Home Assistant

Reading docs is recommended.

1 Like