Another image for an actuator? | Thales IoT Developer Community
June 7, 2015 - 7:02pm, 7546 views
Hello, we are using an actuator as an on/off switch. But by default the image shown is the "dial" with a range of values of simply 0 and 1. That works very well, it controls a GPIO on the Concept Board to set it on and off.
But the image shown on the Sensor Logic Portal is a dial. I am wondering if there is a way to display a switch, perhaps with labels "on" and "off" rather than the dial with labels "0" and "1".
It might be related to the Actuator Description here:
public ACSwitchDescription() {
this.setName("AC Switch");
this.setImage("default.jpg");
Maybe the "setImage" defines the image, but I have never seen any documentation about what options are available other than the "default.jpg".
Thank you!
Roland
Hello,
The idea behind the description is that it is sent to server and it is used by server to load the appropriate image and set the names, labels etc. that describes the particular sensor that is bound to the description.
If you play with these labels you will see that some of them are really displayed by the server GUI. If you enter some other name for the image you should also see that the default image will not be displayed.
As I have leant currently it is not possible to load another image in a simple way and there is no ready to use set of images to choose from. But there is always some way. If you need a specific image it should be possible to load it to the server for you.
Best regards,
Bartłomiej
Hi Roland,
In addition to Bartłomiej's comments, there are two images that could be changed for the sensor: 1) Image for the sensor and 2) Image for the sensor value.
In regards to the sensor image, you can change and modify this using either the Java APIs or in the Admin Portal. With Java APIs, you will need to put the direct URL for the jpg image in the sensor descriptor getImage() method:
public String getImage() {
return "https://......."
}
With the Admin Portal, there's a button you can click when you're in the Device manager to "Edit device" and change the property itself to point to the desired image.
In regards to your original question, it's as if Bartłomiej has stated. There's no simple way and there is no ready to use set of images to choose from. But there is always some way. If you need a specific image it should be possible to load it to the server for you. Thanks.
Thanks Bartłomiej and David.
Yes, I took a look at the property that David mentioned. But as you said, it looks like the value can be changed to a different file name. But there isn't a way to upload something, and now way to know what other images might already be on the server. So I am going to leave it alone, because something might break. But there may be some other properties I am going to examine to see if some changes are useful -- I don't know, but also don't want to break anything.
Roland
Hello Roland,
There's nothing that can be broken - if you set the wrong image pathe it will not be displayed, if you set some other propery it will be displayed (if server is using it for the particular sensor or actuator). The description is sent to server each time the application starts.
Regards,
Bartłomiej