Extending Blockly with new openHAB commands

I do … this looks great! :+1:

A :beers: or l :+1: is appreciated :wink:

1 Like

I am pretty excited of this development, really makes everything less error prone, perhaps even for power users like me…

One small comment: should we use the term “item state” instead of “item value”. To keep the terminology consistent.

1 Like

Let me ask my co product owner :relaxed: Rich, what do you think?

1 Like

I always vote for consistency where ever possible. Now that it’s been brought to our attention I would recommend the use of “item state” too. That way it’s consistent with the concepts docs and all the millions of posting that refer to Item states.

Can you please be exact where exactly you refer your statement to? Only this here (I already changed it)

Or anywhere else as well?

That cought my eye, yes.

Are there pictures of all widgets I could check?

Only at the beginning of the thread for the first release I did (I will always update when I do a release) and all the images in this thread unless you want to build your own version through the Merge Request here: Blockly enhancements 2 - scripts, ephemeris, persistence by stefan-hoehn · Pull Request #1212 · openhab/openhab-webui · GitHub

average state sounds a bit weird though, doesn’t it? After all, a ‘state’ is only valid at a certain point in time. If anything, IMHO it should be ‘average value of state’, ‘state deviation’, etc.
Or remove both ‘value’ and ‘state’? ‘Average’, ‘deviation’, ‘sum’ etc. look equally descriptive to my eye. Exception: ‘previous state’ needs to keep the ‘state’.

Where do you see “average state”? I only see values and the last one in the the drop-down has state.

Commenting based on the screenshots on the first post

  • send command "value" to item MyItem: replace "value" with "command" (directing reader to understand the meaning of command)


    Similarly for “post update”

  • get thing state: probably should be get thing status
    image

Comments on

  • item XX has changed since: would XX state has changed|updated since YY be better? Also, have the same past tense for changed and updated. I think this would emphasise the difference that we are talking about the state. That’s even more important now with these changes, as blockly commands deal with both item objects and the state values.

Comments on Extending Blockly with new openHAB commands - #176 by stefan.hoehn

  • How about: get state of item XX

@maniac103 broughts good points about the exact spelling of the persistence functions. I will add one more proposal for your consideration

  • get <average/delta/deviation> of item XX state since YY

Best,
Sami

First, Sami, I do appreciate that you take care, though keep in mind everybody like me is doing this whole work in our freetime, so I try to avoid double work (no offense, I just like to make that transparent), which is why I hesitate to do many changes afterwards - therefore I am posting everything I intend to implement here during the implementation before (I am aware you only jumped in now and have probably not seen that) Also every change needs to be reviewed later by someone else which is mostly Yannick who already has a big load of work to do (thx Yannick)

To make my life easier: Can you please edit your post above and add images of the blocks you want to have changed and even better scribble the changes what you want to have changed next to the block or on top of it. This avoids misunderstandings on my side.

Thank you
Stefan

PS:
“get <average/delta/deviation> of item XX state since YY” has already been amended by me, see above

1 Like

Hi Stefan, no offence taken, I do appreciate that.

Let me have a look if I can make it easier to pick up the proposed changes – makes it easier for others to comment as well .

I have updated the above post with pictures.

These are suggestions naturally and my feedback, and mostly bikeshedding. I leave it up to you if the changes make sense considering the effort involved etc.

Great, that definitely makes it much clearer and honestly this is almost no effort at all. I will post an update soon.

Here you go

and

Happy now? :wink:

Looks great! That was fast

One comment on the second one, we post state updates, not commands. Are you able to have different placeholders depending on the action, meaning

<send command> "command" to item <item MyItem> <post update> "state" to item <item MyItem>

It was my understanding that you wanted to replace ‘value’ by ‘state’, in which case ‘average value’ would become ‘average state’.
Nevermind though, this has been cleared up by @ssalonen’s comments and your changes :slight_smile:

Probably would be non-trivial, that’s why the original block had “value” as the placeholder, which I thought was a suitable generic term for both what you send as a command or a state update.
i.e. update the state using this string value & send a command with this string value (commands and states are actually typed in OH core).

1 Like

I agree Yannick, I just tried to find a way to check and change the shadow block dynamically but that turns out to be either not straight forward or not doable at all.

By the way, do you by chance have some time eventually to look at the merge request as I do not want to make that even bigger with new changes? Just asking… :relaxed:

1 Like