Control appearance of dashboard tile connected to a virtual switch

My bad, it's not an MQTT question, it's how do I control the tile appearance question.

Aha. I don't use the Dashboard ...... so I'm useless over here!

Not THAT'S a first! JK

Know who to tap? Obviously my original post didn't get a response.

HE staff ..... or someone who knows a ton about Dashboard like @TechMedX

1 Like

Thanks

thanks @aaiyar for the tag

I must start by saying I know nothing of MQTT - not what it does or even what it stands for (not taking the time to google it today, and learn either :slight_smile: )

If you are using smartly for your dashboards it may be possible to adjust the icon depending on what HE's state shows. Dashboard icons are set by the state and cannot to be told to "wait" to my knowledge.

Shades for example have closed, opening, partially open, open, closing, partial closed, closed (unknown). Therefore we can create an icon based on each state.

image

If you can configure the MQTT device as a virtual shade, or other VD has has a state structure like that then yes we can easily create what ever icons you want for each state. If you are working with just on/off switch states, no, not to my knowledge

2 Likes

Yeah, sorry, mentioning MQTT was a bad idea and not relevant to tile appearance.

I'll checkout smartly, thanks!

1 Like

If you need icons post request here (sooner the better my covid time is drying up) :wink:

https://community.hubitat.com/t/smartly-custom-icon-requests/39540

Thank you

1 Like

The retain flag on a 'command' .../set to a device will not be retained but the states that a device reports are sent retained.

I think you're approaching this wrong.. the device should not be an internal HE device but an external MQTT device that you are asking to do something (command) and it then reports back when it has completed that task via it's status payload on MQTT which then gets displayed in HE Dashboard.

The dashboard will always show the internal state of a device as HE sees it. If this is a virual device i.e. one originated and maintained by MQTT and imported to MQTT (HE) then when clicked the tile sends a command to MQTT - you start/stop your process and should report that completion back in the devices status on MQTT which will update the status in HE Dashboard. It won't show an hourglass inbetween but it won't show an update either. Once the process completes it will then show this on the dashboard. Consider your process as a remote network device.

If you are wanting the solution you outline then you need a driver that shows three states for a device 'off' 'working' and 'on' I guess. But you definitely need your process status to feedback via MQTT to update the dashboard.

1 Like

Perhaps if I explained it differently. If you use an internal HE device for this it just turns on and off and so the device updates immediately in dashboard , as you're seeing. HE has no knowledge that you are triggering an external device (process) from this so has no ability to know if that happened or when has completed.

(so intercept the ...onoff/set command in NodeRED or whatever - trigger your process and then update the .../onoff status with the result and HE will then display that on the dashboard)

Would it be possible to tie those actions to the state mentioned above. So trigger a "opening" state on a 'send' command or something to that effect.

@TechMedX - not sure I've understood your question correctly.

What 'commands' you can send depends on the device driver - a switch for example only supports on|off whereas level has 0-100 values. There are devices that could have high,medium,low as settings for example a fan speed. Likewise devices can have just a couple of commands but several states like opening, closing, closed, open. Covers / garage doors are similar to this they have an intermediary 'working on it' state. Choosing an appropriate device driver for this will allow these states to be displayed on the dashboard as either icons or attribute values.

I am not sure in Steven's case if the 'process' has several states, 'triggered' 'running' 'completed' 'failed' or not and if it takes some time to run.

The MQTT app can map expected attribute values like 'active' 'inactive' to 'running' 'completed' or whatever for both status and commands

The "device" on the other end is a shell script that uses systemctl to control my video motion system process. If not a virtual switch on a dashboard tile then what do I use in Hubitat to initiate the MQTT comands?

You are at the moment I guess creating a virtual device within HE and publishing the status of that device to MQTT and using that status to trigger your script (??) Instead you should create a virtual device within my app that is updated from an existing MQTT device (your process).

That device in HE then reflects the reported status on MQTT.

Then from a button on the dashboard for that device send a command ( .../set) to that device which triggers your 'process' launch. When that has been received you publish a status update back onto MQTT and that will be immediately reflected in the dashboard tile state.

Got it. Thanks :+1: :+1:

Just as an adjunct the way you have it set up currently HE updates the dashboard display as soon as you click - but you could immediately send an ...onoff/set command to that device from your process to update the status of the device back to 'off' until it completes and then set 'on' but that's not ideal as it transitions through 'on' back to 'off' then 'on' again

I see. I was trying to keep it in the hourglass until it was told that the command was successful or not. I'll try the "right" VS. :wink:

The way Dashboard tiles work is that they will display "Sending..." until next event is received. With a Virtual device that is almost instant and that event does not come from an external device. To stay at Sending you would have to use something way more custom than a Virtual device, I know of no other way than writing that in a driver or app, don't think it can be done in RM.

2 Likes

Thanks, @markus. That's the definitive I've been looking for.

2 Likes