Please follow Questions Guideline #11… configuration and other code should be shared as properly formatted text. This makes it easier to help you because we can copy/paste and edit without having to rewrite the whole thing.
For your template sensor:
- Make sure the configuration for the trigger-based template sensor is set up under the top-level key
template
. action
needs to be at the same depth astrigger
, and should not have a hyphen.- The
entity_id
in service call action needs to be nested under either adata
ortarget
key. - Make sure the rest of the sensor configuration is included. What you have posted so far is missing significant parts.