New App Features in 2.2.8

Do you mean that you found Connectors as device selections? Please show this rule. What exactly is it treating as a string?

Yeah it would probably be the connectors. I won't be home for another 10 hours. I'll post screen shots tomorrow or late tonight.

I have a guess what you're talking about: if you create a connector for a numeric variable and use the "Variable" connector (device) type, you get a device with a variable attribute that is of type String (and a setVariable() command that similarly accepts a string). Conversion of this back to the numeric type for the variable itself happens automatically, as long as you provide a valid numeric string, but the device/connector itself still reports the attribute as a string (just because that's how the device itself does things, presumably a generic approach they took to allow this connector to work for a variety of underlying types)--so those are the comparison operators you get available in Rule Machine:

If one of the numeric types works for your purpose (e.g., dimmer, illuminance, color temperature), you could use one of those connectors instead. Otherwise, without Hubitat either making some changes to how something works or making separate generic "Variable" drivers for specific types and not just string, I'm not sure what else you could do ... but Bruce will probably have better ideas. :slight_smile:

Yes, Variable connectors are always of type String. The use of these is pretty esoteric. One can use one of the other connector types, e.g. Dimmer, to get an actual number. So if comparing numbers is what is wanted, do that instead of Variable.

Possible bug, when creating a rule in RM 5 to trigger at a certain time i.e 06.00 am when you save the rule the it saves as 06.30 am as per screenshot - not to sure if it is related to time zones but I’m in SA - Australia

Ah, this is most likely a timezone / daylight savings time issue. Presumably you don't have DST right now. Check your timezone on the Location page. We had some issues with those AUS timezones that are 30 minutes off from the rest of the world. Also, try rebooting your hub, and see if that makes any difference.

Yes sounds like it could be, my timezone is set correct and I just tried a reboot with no change.

I had this issue when I first purchased the hub, then it was ironed out in an update.

We will take another look at this.

Great thanks, also just noticed when selecting Days of the week schedule as a trigger the actions don’t trigger - if I select just a time based trigger actions trigger fine, so it looks like there might be a bug in days of the week in the new rule machine.

Yeah, this is a reported bug. Found and fixed for next release.

2 Likes

Awesome mate, appreciate all the great work you guys do :+1:

I got the same error and a hub reboot solved it.

How do I use a Hub Variable from a custom app? I added the connector as a sensor in the app, and I am using sensor.currentVariable, which gives null. I used to be able to do with the Rule Machine 4.x global variable.

What type of connector did you create? That should work for one of type "Variable," but it won't work for others like switch, dimmer, volume, etc. Look at the device page and verify that you see an attribute under "Current States" for whatever you are trying to reference with your .current<AttributeName> property on the device (and, of course, that this object refers to that device).

Thanks. I deleted the old connector and switched it to ColorTemp, everything is working as expected now.

I ran into this on Button 5.0. I wanted to have a button press execute the action in a rule. The option is presented but the list of rules are just my buttons. See pic.


At this point I'm not sure if this is a bug or I'm using something wrong again.

Neither. I have on my list to get Rule actions available in Button Rule. It just hasn't gotten done yet. Soon...

5 Likes

I have a work around in place with a virtual switch. If you had an SLA, you'd be killing it. 2 Minute response time from a lead developer (I know just one of the hats your wear) is unheard of! Thank you for all the hard work you put in.

4 Likes

With the Rule Machine global variable, I used to use capability.sensor (and its currentVariable attribute) to get at my Time connector variable. That doesn't work with the DateTime Hub Variable. What capability should I be using for DateTime connectors?

A quick inspection of the device shows that it implements the "Sensor", "Actuator", and "DateTime" capabilities (that last one is undocumented and news to me, so I'd probably stay away :slight_smile: ). So, if you're using "capability.sensor" to select, it should still work. I just tested and it does for me. If you wanted to very specifically only choose devices with the "Connector DateTime" driver (as you might if you depend on specific attributes or commands), you could use "device.ConnectorDateTime" instead.

That being said, currentVariable will not work on this device (regardless of how you select it, which does not matter--you have access to all attributes and commands once you get a reference to the device). If you are not familiar, that is equivalent to currentValue("variable") and means that an attribute called variable must exist. You can see under "Current States" for a device like this that it does not--only an attribute called dateTime:

Screenshot: 'Current States' for a Connector DateTime device showing only a dateTime attribute

So, you need to access the value of this attribute by using currentValue("dateTime") or currentDateTime. Note that this attribute gets returned as a string. If you need a Date object back out of this, you'll have to use something like Hubitat's built in toDateTime() method or something available from Java/Groovy.