[Solved] How to update a HA Dropdown Helper with output of NR sequence

Hi, hoping someone can assist. You will probably need some patience :slightly_smiling_face:

Background:
I’m a complete novice to NR and have little to no coding experience (OK years ago did a lot in Excel VB, so please take pity on me) but I have been encouraged to give NR a go. Consequently I have been fumbling my way round, watching NR videos without really absorbing much and getting some help from others elsewhere but my discussion is off-topic there, and so it was suggested this is the place for learning and assistance.

I have the NR integration within Home Assistant. Current version: 13.3.2
Home Assistant 2022.8.7
Supervisor 2022.08.3
Operating System 8.5

My Flow:
For my first NR flow I have set up a sequence to determine what electricity tariff period we are currently in, being Time Of Use (TOU) tariffs of Peak, Shoulder and Off-Peak.

Ultimately I am hoping to automate functions of my home energy systems (grid PV and off-grid solar PV and battery storage system) but for now let’s start with something basic.

I seem to have successfully managed to create a sequence which generates the string outputs (“Peak”, “Shoulder” or “Off-Peak”) to a debug node but I am struggling with how to make it update a Dropdown Helper within HA.

This is my Helper config details:

This is the Call Service Node I have:

and it gives this error:

"Call-service error. required key not provided @ data['options']"

Which I believe means something needs to be placed in the Data field of the Node configuration window, but I do not know what. I know nothing of JSON.

I’d be grateful for any clues to help point me in the right direction. I can imagine I will be wanting to perform various Call Service operations to HA for many future such flows / sequences I might dream up, so at least getting an idea of how this works would be helpful.

If I need to provide more info, let me know an I will do my best.

Thanks

Hey Watts - good to see you have landed over here.

OK first thing to try which i think will work (or will give us a better error)

In the Data field where it has the J; (stands for Jsonata - which is like a fancy scripting and manipulation language for Javascript) - lets try

{ “value”: payload }

Click the bottom box that says to show debug info)

and then trigger your flow

And let us know what that shows

Craig

Thanks. This is what the debugger windows shows:

28/8/2022, 1:12:17 pm[node: Tariff Type](http://homeassistant.local:8123/api/hassio_ingress/RbT3ePDcRwkL042BMJOx2Cx_yr9Dge6O_ahJfU57mJI/#)msg.payload : string[8]

"Off-Peak"

28/8/2022, 1:12:17 pm[node: Set TOU Tariff](http://homeassistant.local:8123/api/hassio_ingress/RbT3ePDcRwkL042BMJOx2Cx_yr9Dge6O_ahJfU57mJI/#)msg :

{ domain: "input_select", service: "set_options", data: object }

28/8/2022, 1:12:17 pm[node: Set TOU Tariff](http://homeassistant.local:8123/api/hassio_ingress/RbT3ePDcRwkL042BMJOx2Cx_yr9Dge6O_ahJfU57mJI/#)msg : string[63]

"Call-service error. required key not provided @ data['options']"

Here you go - try these options instead

Craig

Thanks, that seems to be working now. I used the States developer tool in HA to manually change the state of the dropdown helper to something wrong then ran the NR sequence, and it updated the value correctly.

So I had used the incorrect “select_xxx” option type and also the JSON text in the data field. I can see that’s going to take some learning to work out what goes there…

Something else I notice, often when I click to trigger the sequence I get a different error:

Call-Service attempted without connection to server.

but not all the time. Sometimes the sequence runs OK.

What are you running this on is it a Raspberry Pi ? Is it very busy ?

Do you still have the automation for the Helper running every minute or have you stopped that ?

Yes i was not aware of it either (as i do not use Helpers etc in HA) So it took a little bit of Googling on the forum to find a flow with someone else doing it

If you are using normal entities it is much easier

Craig

Yes a Pi4. I’ve no idea whether it’s busy or not, what’s the measure for that?

I had changed it to every 5-min (updating a different helper) but have now disabled that automation.

I hope so!

I am hoping it won’t be long before I can construct an automation for managing when my off-grid system changes its primary mode of operation.

At the moment I’ve been experimenting and I seem to have found a nice pattern I am settled into, but am doing it manually.

Basically:
i. Overnights run from the off-grid system battery
ii. Daytime run from the grid PV via the off-grid system while the off-grid PV array recharges the battery.

The timing of the operating mode changeover might be based on some logic involving various parameters:

  • Offset to sunrise/sunset
  • Battery state of charge
  • TOU tariff period
  • How much excess grid PV power is available
  • Solar forecast or weather forecast

I have entities in HA with all of those things and the inverter’s operating mode can be changed from HA. That’s done via the Solar Assistant Pi connected to the off-grid inverter which integrates with HA via MQTT. Soon SA will add additional inverter parameter controls to this. I am particularly hoping for control of the various charging parameters for the battery, e.g. so it can automatically decide if/when to supplement daytime charging from the grid PV system, and by how much (can do 500 W increments).

Yes well you have some tradeoffs in there - would obviously make the most sense to run from the Battery during peak hours (assuming you have TOU tarriffs) - but with your off-grid system you are limited with your peak power draw - so that gives you some challenges !!

You can use MQTT as your pathway to integrate all these things together for sending info around (rather than having to tie in through the Home Assistant add-ins) which might make it easier in the first instance without having to worry about all the diferent states etc etc

I do something like the conditions you have set above to manage my batteries and solar etc

Best bit of advice i can give you is to build it up slowly and in stages.

For instance i have a HA integration for our AC system - through that integration i can send info to NR as to the temperatures in each of the zones and it then makes decisions about the best way to manage our PV energy between Charging the batteries, turning the AC on for the main part of the house or diverting excess energy into our hydronic heat pump.

At this time of the year we do not generate enough solar to run the house so i charge the batteries from off-peak overnight (to varying levels depending on upcoming solar for the next day etc) and then have a reservation for the next day to try and get through the shoulder and peak periods (with peak having the priority obviously)

Happy to help you out along the way

Craig

Yes, TOU tariffs, hence the trial automation I started with above. I figured it was a logically simple enough process to choose to start to understand how this NR thing works. I don’t actually expect to use that entity for anything other than to display what tariff period we are currently in (for the benefit of the wife). If I am going to automate anything on the basis of TOU then I would presumably do that directly from NR.

While the little 4 kW off-grid inverter I’m currently using is limited in power output, there are a couple of things aiding it:

  • I will upgrade it with one with double the output capacity, which should resolve most such issues
  • Selected particularly heavy loads are not supplied via the off-grid system (e.g. the hot water system, the ducted AC and another large split AC, our oven and the induction stove only get power from the grid side) but all the mancave and granny flat circuits are covered by the off-grid system (including granny flat oven/stove) along with most of the our home’s GPOs and all lighting.

And remarkably, despite some close calls, this little off-grid inverter has not tripped once during this past week of experimenting, even though I saw a peak of over 5 kW being passed through while 1.5 kW was going into the battery from the off-grid array, and on a few occasions several minutes of > 4 kW of load occurring.

Still, it would be way too easy to sail a bit close to the wind so I have my eye on an 8 kW model. No point going higher than that as my per phase import limit is 32 A (240 V) anyway. We had some instances last week of the washing machine in each dwelling going at the same time. Since they heat their own water they each draw ~ 2 kW.

Sage advice. It’s taken me months to get this far.

Yes, load management is on my radar as well. I have the Daikin ducted system integrated into HA. Mainly that will be about ways to curtail Peak period consumption since it is powered by grid supply only. Daytime is fine with solar PV, it’s mainly at night.

Much appreciated.

You should start a new thread (and mark this one as solved) for any new issues.

In the meantime it is worthwhile reading this thread a few times about some integrated energy management with Home Assistant

Craig

OK, dumb question: How do I mark it so?

Yeah just realised they do not support that on here which is pretty dumb

No worries - sorry for the red herring

Craig

No biggie - I changed the title of the thread to indicate same thing.

The automation seems to be working. I changed the trigger a little, and may play with that some more. The history is showing it has updated correctly so far.

Woo hoo way to go - Node red is not THAT SCARY afterall !!

Good work hanging in there

Craig

1 Like

Thanks. I’m stuck on something else (changing the Load source priority of my inverter) but need to play some more before posting another “help!”.

Dont go banging your head on a brick wall - thats the fastest way to get frustrated - start another thread and explain where you are at and what the problem is - i find that this often clarifies in my mind where to start looking for issues.

Craig