2023.7: Responding services

That appears to be the route he decided to go, it was discussed on discord. A few options were tossed out, we will see if that gets accepted.

EDIT: that does seem to solve the problem. IIRC I proposed a new trigger type, this just adds to any trigger which seems to be a better approach.

So I still don’t understand script response as I have not had a chance to play with it yet but is it possible to do something like write your own function?

e.g. call scrip “geometric mean”, pass it two or more values have the script do some calculation and return a result?

Well, you can’t actually respond yet from a script. I mean, you can with a custom event, but it’s not the same.

I wouldn’t be surprised if this is added sometime in the future.

Yes, that would be a goal.

1 Like

You can respond from a script, just use the stop action

1 Like

Nice, I missed that

Based on the documentation I missed that @crzynik pointed out…

add_five:
  variables:
    value_plus_five: >
      {{ {'value': value + 5} }}
  sequence:
  - stop: "returning value + 5"
    response_variable: value_plus_five

I believe you’d just call the script like this as well.

- service: script.add_five
  data:
    value: 3
  response_variable: result

and you’d access the result in a later on variable/template

You’d have to inspect the result to see if it adds any other layers to the response value. I’d guess it does not, I’d have to check otherwise. I.e. {{ result.value }} would return 8

3 Likes

I don’t have this issue in Home Assistant 2023.7.1

I have this weird issue with my Energy dashboard ever since I’ve updated to 2023.7.x. Don’t really understand what is going on.

I have added the following sensor with my energy dashboard:

image

This is a template sensor with the following code:

- sensor:
      - name: "solarmanlocal_production_daily"
        state: "{{ states('sensor.solarmanlocal_solar_today')}}"
        unit_of_measurement: kWh
        device_class: energy
        state_class: total_increasing
        unique_id: solarmanlocal_production_daily

The sensor.solarmanlocal_solar_today abiously presents the same 39 kwh.

Settings in dashboard:

image

Now the error:

Over the past days it reports really high numbers:

image

While I wish this would be true, it isn’t. It acutally is 39kWh.

The erro is always in the morning:

image

What is there to investigate? I don’t understand where to look.

I was staring at something similar yesterday. It’s happened a handful of times. No restarts or reload around these times: just this seemingly random spike in energy. My panels can only produce about 4kWp, so it’s practically impossible to get this amount of solar.

This is from my energy dashboard. Note the two peaks of 15kWh and 20kWh respectively with a total consumption of over 40kWh for yesterday.

This is the same data plotted with a stats card, grouped by day showing the correct total of about 16kWh.

As you can see here the raw power sensors have no such anomalies.

Just updated to this release and got this in log:

2023-07-11 12:41:26.502 ERROR (MainThread) [homeassistant.components.media_player] The openhome platform for the media_player integration does not support platform setup. Please remove it from your config.

What does it means? I don’t have the openhome platform setup.
What to do?

Nothing as it’s a bug currently. I believe it will be fixed in a future .x release. (ignore it for now)

1 Like

Fix is made, waiting for next release:

2 Likes

Could the source sensor be the issue and report unexpected values? Maybe it helps to check the statistics in the dev tools around the time of wrong values.

mystrom switch now useless

have a mystrom switch to meassure solar input, but with the recent HA update i cant use the yaml anymore and the real integration only shows me on/off… but i cant get any power readings off it… ?!

Nope, all sensors seem normal:

image

Just wondering because you have spikes in a total_increasing sensor, means at certain points it decreases which would be wrong I guess

yes, and that’s the weird thing. There are no spikes in the sensors, non at all. The anomaly is only on de energy dashboard.

It might not be the root cause but the anomaly is also in the source sensor:
IMG_2036

Just an idea, hope it helps

image
Don’t think that’s the same spike. Also on the energy dashboard its on completely different times.

Seems like the @allenporter blueprint is broken. I clicked on it to import, and it doesn’t appear in my list of blueprints. Tried this twice without success.