I manage a number of system that we use for monitoring and automation. For the monitoring, I have rules with email and/or text alerts which I have created using Blockly. I am interested to know if there is a way for all of these rules to reference an email address (in the “to” block), and a house name (in the “with subject” block) so I don’t have to go enter these in each alert rule manually when I build these systems.
Thanks, I don’t understand how to implement any of these options.
rikoshak how would I create an item, say for the email address? Then I would just plug the item in where the email address is in this script? I tried creating an item with the ID of my email but it wouldn’t accept the special @ character it seems.
Wow I’m completely overwhelmed. Widgets are new to me so “Use an Input widget to populate it.” is certainly the part I need.
If I understand what this does, it creates a “state” for this item right? So where the state of one of my temperature items may be “70”, through this widget, the state of this “Email Address” Item I created would be email@example.com. Then I can get my rule to pull that item state to use for where the email is going. Does that sound right?
If so, it looks like I create the Item, save it, click on metadata, Default List Item Widget, then choose input list item.
This gets me to the editing table for the input widget (if I’m saying that right). But there are a bunch of parameters that are completely unclear to me. And I DO see the same line items in the instructions, but they are equally confusing to me. If I click on the “F7 Input Docs” link to determine what kind of input I should enter it leads me to a web page with TONS of complex code for doing things way more complicated than I need.
In that edit form, it must be a couple of really simple entries that result in the state of the Item to be the email address I want?
Mostly right and it may just be language choice. But it’s important to be absolutely correct and understand these because these are really very basic openHAB concepts which you should have a handle on before attempting to write rules. If you don’t understand the information in the Concepts section of the OH docs you will have a hard time with openHAB. And what Items are and how they work is perhaps the most important concept in OH.
Just diving in without reviewing at least the Concepts and the Getting Started tutorial is a recipe for frustration and much waisted time.
To answer this question, the widget doesn’t create a state for the Item per se. It provides a UI element on MainUI that allows you to change the state of the Item manually by typing in the value. This is not the only way to set the state of an Item.
And yes, your rule will use the state of the Item in the rule (there’s a “get X from Item” block).
All you really need is in that very first line of the docs that it links to.
All text inputs Supported types: text, password, email, tel, url, date, number, datetime-local
You want an email address so put in email for the Input type.
rikoshak despite your very detailed instructions (thanks!) I was still having problems getting it working. But the part about being able to reference an Item label gave me the idea to just create an email address item with the actual email address as the label. Then I use the blockly script to call that Item. This is super simple and seems to work. Is there some reason I shouldn’t use this way of doing this?