How to export HE Global Vars to Sharptools?

Hi

I am new to HE and Sharptools.

How do I expose HE Variables to Sharptools Dashboards?

Also, how do you connect SharpTools to multiple HE Hubs?

Any assistance much appreciated?

Will post on HE Community too.

Hi @Michael_Horton welcome to the community and thanks for posting.

The most common approach is to use a virtual device to copy the variable to. What kind of variables are you trying to expose and are you just looking to view them in SharpTools or you also want to update them?

HubConnect tends to be the most popular solution. If the hubs are on the same network, you might be able to use the new Hub Mesh feature:

1 Like

@josh thanks.

Ok, I am already using Mesh, there is an inherent delay on device states when using it, it is acceptable but exacerbated when putting a cloud service like Sharptools on it, so not sure if Sharptools is a viable solution if it can only connect to one Hubitat hub.

Will only degrade further when adding additional hubs on top.

I understand, from a Sharptools revenue basis this approach encourages users to purchase multiple licenses but seriously compromises the single pane of glass view of HA.

One of the HE hubs is managing Heating zones and Hot water the other everything else plus oversight of the heating hub.

The heating HE uses global variables to flag heat demand for each area, then the central process manages the actual boiler/furnace operations based upon overall demand and efficiencies.

So will need to create virtual devices for each variable, share over the mesh and import into Sharptools.

That will do in the short term while I source a more long term solution.

Thank you, very helpful :slight_smile:

You don’t need another SharpTools license for the other mesh connected hubs. The devices from mesh connected hubs will be synced to the main hub, and can be authorized to SharpTools from the main hub.

Or you can edit the device handler to include multiple attributes to map multiple HE variables in one virtual device, instead of multiple devices, if that makes things easier for you.

@James

Sorry new to HE too :slight_smile:

Can’t find a Virtual Variable device to push the HE Global variables into.

Can you point me to FAQ or something that will shed some light on how to do this please?

Thanks

What kind of variables are you trying to use? A common approach is to map variables into standard virtual devices – for example, mapping a Boolean variables into a Virtual Switch.

Alternatively, you could use a custom driver for mapping Hubitat variables into - for example, I put together a custom driver which has slots for switches, numbers, and text in the following post:

:link: Virtual Values Custom Hubitat Driver

Edit: And for the sake of completeness, it’s worth mentioning that SharpTools Variables can be exposed natively to your SharpTools Dashboards.

2 Likes

@josh

Thankyou - makes perfect sense!!!

I have a bunch of Boolean vars - one for each room - HeatDemand_room

The Switch is perfect thanks!!

On principle I am fine having end user displays running in the cloud but not HA logic, I want that local.

So at the moment I am using Sharptools to create room displays and testing using Sharptools rules as an oversight check of HE rules - Ie raise an alarm if xyzzy occurs, not sure how that will run - but an idea.

2 Likes

Have used the Virtual Values Custom Driver -

Thanks

2 Likes

@josh anyway to be able to use the variable in the text field in the Device - such as %HeatDemand% would insert the content of the variable HeatDemand - TRUE or FALSE?

It would remove the need to create a Rule to trigger on VAR change and populate Device txt Field ?

Too much?

Can you clarify what you mean by ‘text field in the Device’? Do you mean the Virtual Values custom driver?

The comments at the top of the driver code have some tips that you might find helpful as to what each command does:

Virtual Values
    Author: @josh (SharpTools.io)
    Description: The Virtual Values device driver exposes a variety of methods which can be used to 
        set values of specific attributes. These attributes can then be used in other Apps within 
        Hubitat or in SharpTools.io Dashboards by using Hero Attribute tiles.
        This serves as a flexible 'utility' device for setting arbitrary values that you want to use
        elsewhere.
    Command to Attribute Mappings
        setText              →       text
        speak                →       text   *1
        deviceNotification   →       text   *2
        setNumber            →       number
        setLevel             →       level, [switch] *3
        on                   →       switch
        off                  →       switch
    *1 speak() is a wrapper method for setText to provide compatibility with apps that support Speech Synthesis devices
    *2 deviceNotification() is a wrapper method for setText to provide compatibility with apps that support Notify devices
    *3 setLevel will issue the off() command if the level is set to 0 and will leave the level set at the previous value
    Other Notes:
        The on/off commands are useful for reflecting an active/default state in SharpTools.io dashboards which is helpful
        for setting the color of your tile based on the device's state.

In Hubitat you can use variables as %variablename%.

If that could be used in the Set Text field in the Device anytime the Variable is updated so would the device without the need for Rules to update the field on Variable change

I don’t personally use Hubitat’s built-in Rule Machine, so I can’t speak to it. If you haven’t figured it out next week, feel free to ping me and I’ll poke around RM a bit. :wink:

Edit: Hubitat also has variable ‘connectors’ which are basically virtual devices. I can’t remember which capabilities they offer off the top of my head though.

2 Likes

Thanks

I am new to both Hubitat and Sharptools :slight_smile:

I received my first Hubitat 24 Dec 2020 :slight_smile:

I am reading up on Rule Machine Variable Connectors now - looks like it could make life a bit easier :slight_smile:

Ok the problem seems to be in The SharpTools Apps on Hubitat.

It does not give the ability to share the Rule Machine Connectors - Virtual Devices to Sharptools.

These do not show up in the Sharptools App in Hubitat :frowning:

So the virtual devices exist just not shareable with SharpTools.

The only way now is to replicate every Virtual Device with another virtual device and create a rule to sync them :frowning:

@Michael_Horton, you can add the Variable Connector device to SharpTools by following the instructions in the post below. It doesn’t show up in the SharpTools auth list because it doesn’t implement the core capabilities supported by SharpTools, but can still be found and authorized using the method.

1 Like

You guys are so cool!!!

Thank you!!

Apparently, I never used the RM Connector. :joy: I did a quick test before posting by creating a RM Connector Variable device directly, which can be authorized using the the method mentioned above, but not those created in RM’s Connector section, because the parent RM Connector device might not implement the needed capabilities.

That being said, I am wondering if it would make things easier for you if you use Virtual Switch instead of HE Variable to represent the HeadDemand status (true/false → on/off). So you don’t have to worry about syncing between the variables and the virtual switches.

1 Like

:frowning: not getting anywhere

Managed to get the Virtual Devices into Sharptools but they have no data :frowning:

And can’t find a way to actually get the variable content.

I use variables around Heating systems to avoid issue later.

Currently I have 7 zones in the house, about increase them.

Each zone is managed with a very simple rule and built in Apps for Thermostat Controller .

As each zone requests Heat it gets flagged as a VAR HeatDemand_Bathroom.

The Rule that updates that Variable also sends a command to the Valve to open.

I have a Trigger if ANY HeatDemand is TRUE then Turn on Boiler and Radiators.

Slightly more complex because the Rule that controls the actual boiler switch also performs a series checks determine if Turning on the heating is the right things to do.

This way I have just one place where all the safety logic resides and a single rule that touches the Boiler and radiator switches.

I’ll use Hubitat Dashboards for diagnosis Dashboards and use Sharptools for the end user displays so not an issue.

Thank you both for all your help

Very much appreciated!

Is there any reason why these variables cannot be replaced with the Virtual Switches? Or you may just need additional RM rules to sync the variable values to the mapping Virtual Switches to expose them to SharpTools.

I personally think using Virtual Switches may be more direct and you don’t need to worry about the sync between variables and Virtual Switches. Cannot speak for Hubitat and don’t know what you mean by the issue later, but since Virtual Switch is using the fundamental device handler the system supports, so it may just be more generally supported.

Ok I am struggling with this.

I have Text I would like to put on the SharpTools displays.

In Hubitat I have a Global Variable ‘Alert-Message’ this is displayed on the TV (if On) and I would also like to display on the Tablets using Sharptools.

Additionally I have an HE Global variable HolidayCountDown, that HE decrements at 00:01 every night and I would like to put this on Sharptool displays also.

I have Setup RuleManager Connectors for them both so they show up as devices, just can’t figure out how to get these into Sharptools.