Update an item from another item via rules GUI

  • Platform information:
    • Hardware: Raspberry Pi 4B
    • OS: Openhabian
    • Java Runtime Environment: 11.0.18
    • openHAB version: 3.4.4

Hi there,
after reading for a time and diving into the configurations I’m now trying to update a newly created item called “Tageswert_Erzeugung_Solar” from a MQTT item called “Solar_AC_Tagesertrag”. It’s the daily production value from my PV inverter, which grows over the day, has its maximum in the evening and starts with 0 the next day. I added the -non semantic- item that I wanted to fill by a rule each day at 23:55.
Is there a way to manage this via the rules GUI only, or have I to learn the code syntax and do it in the code section? When I’m putting in the “Solar_AC_Tagesertrag.state” variable or even “Solar_AC_Tagesertrag.state as DecimalType” in the state field of the rules mask it only takes the variables name as a text.
All the configurations I did until now were by use of the GUI (except mapping some textes to values) and I would prefer that method, if possible.

configuration: {}
  - id: "1"
      time: 23:55
    type: timer.TimeOfDayTrigger
conditions: []
  - inputs: {}
    id: "2"
      itemName: Tageswert_Erzeugung_Solar
      state: Solar_AC_Tagesertrag.state
    type: core.ItemStateUpdateAction

You’ll have to use a Script Action. You cannot specify the value to update an Item as the state of another Item.

However, Blockly is really easy to learn and graphical too. Your script would be a one liner/blocker.

Obviously you’ll need to replace the “MyItem” parts with your actual Items.

If by this you mean you had to create a .map file, OH 4 now has support to create these in the UI.

1 Like