[SOLVED] Image selection heuristics not updating for some

Posted on
Mon Feb 16, 2015 8:44 am
Shutter offline
Posts: 345
Joined: Mar 07, 2014
Location: London, UK

[SOLVED] Image selection heuristics not updating for some

I have a whole bunch of images that are working for most of my devices that I'm using image selection heuristics on, all except 4 - and I can't for the life of me figure out why. The devices are for Autolog's Stella-Z plugin but I don't think it's the plugin that's the problem.

I have 4 images, one for each room I have a Stella-Z in, and I'm using the following in the control page:

Code: Select all
Display: Device State
For: Living Room Stella Z Conroller
Mode (on or off)

As image: HeatingPage_LR+.png

I therefore have another image in the same folder called HeatingPage_LR+on.png and the same again for the other 3 rooms with corresponding names, MB instead of LR and so on.

Indigo is just not updating the image when the state becomes ON or OFF correctly. I've duplicated the image and changed it from image to text to check what the output is displayed as, and to check that it's updating the actual devices correctly when I change what the devices is doing. There are 3 states: Off, Heat Pending, and Heat On. Do image names have to match what the devices would display as text? Because I've tried that and that doesn't appear to make a difference. I've also tried true/false, on/off, both of which also had the base image with just the … +.png - but that didn't work either. I've also rebooted the server multiple times to see if things were being cached, all to no avail. I've created a test page and added the devices again and they still don't update correctly - sometimes it does but doesn't go back to the off image. Sometimes the on image is shown instead of off when the Stella is off.

Ideally I would like it to reflect all 3 states: Off, Heat Pending, and Heat On, but I can't get this on/off to work correctly so I'm stuck. All the other images I've made for this work just fine. for example, I've made a Boost icon which similarly has a Mode (on or off) and corresponding HeatingPage_Boost+.png and HeatingPage_Boost+on.png and that works just fine. Could if be something to do with the Heat Pending state? But once it becomes on surely the …+on.png image should be used.


Well and truly baffled.

Simon
Last edited by Shutter on Mon Feb 16, 2015 10:17 am, edited 1 time in total.

Posted on
Mon Feb 16, 2015 9:22 am
autolog offline
Posts: 3988
Joined: Sep 10, 2013
Location: West Sussex, UK [GMT aka UTC]

Re: Image selection heuristics not updating for some

It isn't the plugin that is the problem, it is the plugin's author :wink:

My only excuse is that it was my first attempt at a plugin and now I am older and somewhat wiser, I would do things slightly differently i.e. correctly :)

So even though the mode suggest it should be 'on' and 'off', the values for mode are actually stored as 'active', 'inactive' and 'delay'

If you set-up your images with the names as follows it should hopefully work:
  • HeatingPage_LR+.png
  • HeatingPage_LR+active.png
  • HeatingPage_LR+delay.png
  • HeatingPage_LR+inactive.png

I'll add it to my list of things to fix :)

Posted on
Mon Feb 16, 2015 9:46 am
Shutter offline
Posts: 345
Joined: Mar 07, 2014
Location: London, UK

Re: Image selection heuristics not updating for some

Ah-ha. I won't hold it against you. :D

Thanks. The on/off - active/inactive work just fine now. So, if I understand correctly the +delay image should display the heat pending state? I'm not seeing that.

Posted on
Mon Feb 16, 2015 10:09 am
autolog offline
Posts: 3988
Joined: Sep 10, 2013
Location: West Sussex, UK [GMT aka UTC]

Re: Image selection heuristics not updating for some

Hi Simon,
Shutter wrote:
... So, if I understand correctly the +delay image should display the heat pending state? I'm not seeing that.

No, the +delay image shows the situation where the Stella-Z was due to wake-up but the wake-up has been missed. So it it indicates an overdue z-wave communication situation.

The heat pending state isn't currently shown in the mode - maybe it should be - another one to add to my list :)

Posted on
Mon Feb 16, 2015 10:16 am
Shutter offline
Posts: 345
Joined: Mar 07, 2014
Location: London, UK

Re: Image selection heuristics not updating for some

autolog wrote:
No, the +delay image shows the situation where the Stella-Z was due to wake-up but the wake-up has been missed. So it it indicates an overdue z-wave communication situation.

The heat pending state isn't currently shown in the mode - maybe it should be - another one to add to my list :)


Gotcha. Looks like I have to make another icon for the delay then - which is worth indicating on the CP. Adding the heat pending would be fab, already have a nice icon for that. :wink:

All working as expected now. Thanks.

Simon

Posted on
Mon Feb 16, 2015 10:44 am
autolog offline
Posts: 3988
Joined: Sep 10, 2013
Location: West Sussex, UK [GMT aka UTC]

Re: Image selection heuristics not updating for some

Shutter wrote:
... Adding the heat pending would be fab, already have a nice icon for that. :wink:

I have just PM'd you a version that may do what you want :)

Posted on
Fri May 08, 2020 2:58 pm
mgolden50 offline
User avatar
Posts: 247
Joined: Jan 29, 2007
Location: Chandler, AZ

Image selection heuristics not workin for me. Not sure why.

Stumped!
I've done every thing I though was necessary:
Loaded the collection of .png files into the Variables folder--named as shown below
Created a variable called: WeatherIconToDisplay
Periodically run a Python script that updates that updates that variable with one of the .png file names based on NOAA Plus forecasts.
Restarted Indigo server and the Indigo app
In control panel, added new variable image called WeatherIconToDisplay
In that variable selected the Weather+.png value do display as image

But then...
The only image displayed is the blank image Weather+.png
Not image ever gets displayed reflecting the changed file names in the WeatherIconToDisplay variable.

What am I doing wrong???

Weather+.png
Weather+ClearNight.png
Weather+CloudyNight.png
Weather+CloudyRainNight.png
Weather+CloudySunShowers.png
Weather+CloudyWindyNight.png
Weather+HeatAlert.png
Weather+HeavyRain.png
Weather+LightRain.png
Weather+Overcast.png
Weather+PartiallyCloudy.png
Weather+Rain.png
Weather+Sunny.png
Weather+ThunderStorm.png
Weather+WindyNight.png
Attachments
Screen Shot 2020-05-08 at 1.54.15 PM.png
Screen Shot 2020-05-08 at 1.54.15 PM.png (151.38 KiB) Viewed 3906 times

Posted on
Fri May 08, 2020 3:06 pm
matt (support) offline
Site Admin
User avatar
Posts: 21411
Joined: Jan 27, 2003
Location: Texas

Re: Image selection heuristics not workin for me. Not sure w

mgolden50 wrote:
Periodically run a Python script that updates that updates that variable with one of the .png file names based on NOAA Plus forecasts.

Are you updating the variable value to the full file name or just the substring after the + and before the .png? It should be the latter. For example, you would change the variable value to: ClearNight, CloudyNight, etc. Also note the change isn't reflected in the Control Page editor window, but should show in the Browser preview and Indigo Touch.

Image

Posted on
Fri May 08, 2020 4:13 pm
mgolden50 offline
User avatar
Posts: 247
Joined: Jan 29, 2007
Location: Chandler, AZ

Re: [SOLVED] Image selection heuristics not updating for som

Hi Matt,

That wasn't at all obvious in the heuristic instructions (at least to me). Perhaps it would be useful to others to add your examples to the instructions.
The change worked immediately.

Thanks, as always, for the support and the rapid response.

Mike

Posted on
Fri May 08, 2020 7:41 pm
matt (support) offline
Site Admin
User avatar
Posts: 21411
Joined: Jan 27, 2003
Location: Texas

Re: [SOLVED] Image selection heuristics not updating for som

I think step/info #1 here describes it pretty well?

Image

Posted on
Sun Jun 28, 2020 12:13 pm
mgolden50 offline
User avatar
Posts: 247
Joined: Jan 29, 2007
Location: Chandler, AZ

Re: [SOLVED] Image selection heuristics not updating for som

Once again I find myself stuck with trying to get image heuristics to work properly do do something that has worked in the past just fine for me.

I have this list of .png files in the variables folder:

weather+.png
weather+chancerain.png
weather+chancestorms.png
weather+clear.png
weather+cloudy.png
weather+fog.png
weather+mostlycloudy.png
weather+mostlysunny.png
weather+nt_chancerain.png
weather+nt_clear.png
weather+nt_cloudy.png
weather+nt_mostlycloudy.png
weather+nt_partlycloudy.png
weather+nt_rain.png
weather+nt_tstorms.png
weather+overcast.png
weather+partlycloudy.png
weather+partlysunny.png
weather+rain.png
weather+sunny.png
weather+tstorms.png

And different ones of those names placed placed into the variable used by the CP to display the selected image. But he blank base image never gets replaced.
When I display the variable as text the value is the correct one. So why won't the images display correctly?

I have assiduously copied at pasted the names of the ping files into my Python code which set the variable to be used for selecting the display image to avoid the possibility of misspellings.
And I see the correct file names in the variable. I have done all of the server and app restarts required... but still no images displayed.

I must be missing something obvious. But once again thanks for your support.

Posted on
Sun Jun 28, 2020 1:26 pm
matt (support) offline
Site Admin
User avatar
Posts: 21411
Joined: Jan 27, 2003
Location: Texas

Re: [SOLVED] Image selection heuristics not updating for som

Did you stop and restart the Indigo Server?

And can you copy/paste your python code into a reply so we can see what it is doing?

Image

Posted on
Sun Jun 28, 2020 1:48 pm
mgolden50 offline
User avatar
Posts: 247
Joined: Jan 29, 2007
Location: Chandler, AZ

Re: [SOLVED] Image selection heuristics not updating for som

Yes multiple times. And the Indigo app also each time

Posted on
Sun Jun 28, 2020 3:45 pm
matt (support) offline
Site Admin
User avatar
Posts: 21411
Joined: Jan 27, 2003
Location: Texas

Re: [SOLVED] Image selection heuristics not updating for som

matt (support) wrote:
And can you copy/paste your python code into a reply so we can see what it is doing?

Image

Posted on
Sun Jun 28, 2020 4:16 pm
mgolden50 offline
User avatar
Posts: 247
Joined: Jan 29, 2007
Location: Chandler, AZ

Re: [SOLVED] Image selection heuristics not updating for som

Here's the code. Please note that the weather label values display as they should.

Code: Select all
## Prepare to Pick Weather icons and labels
ShortDayForecast = indigo.variables["WeatherTodayShortForecast"].value
ShortNightForecast = indigo.variables["WeatherTonightShortForecast"].value
## Pick the Weather Icon To Display
if (indigo.variables["EveningTime"].value) == "true" or (indigo.variables["NightTimeOn"].value) == "true":
   if "Rain" in ShortNightForecast:
      WeatherIconToDisplay = "weather+nt_rain.png"
      WeatherIconLabel = "Rain"
   if "Windy" in ShortNightForecast or "Wind" in ShortNightForecast:
      WeatherIconToDisplay = "weather+nt_clear.png"
      WeatherIconLabel = "Windy"
   if "Clouds" in ShortNightForecast and "Increasing" in ShortNightForecast:
      WeatherIconToDisplay = "weather+nt_partlycloudy.png"
      WeatherIconLabel = "Cloudy"
   if "Cloudy" in ShortNightForecast and "partly" in ShortNightForecast:
      WeatherIconToDisplay = "weather+nt_partlycloudy.png"
      WeatherIconLabel = "Cloudy"
   if "Cloudy" in ShortNightForecast and "mostly" in ShortNightForecast:
      WeatherIconToDisplay = "weather+nt_mostlycloudy.png"
      WeatherIconLabel = "Cloudy"
   if "Cloudy" in ShortNightForecast and "partial" not in ShortNightForecast:
      WeatherIconToDisplay = "weather+nt_partlycloudy.png"
      WeatherIconLabel = "Cloudy"
   if "Thunder" in ShortNightForecast:
      WeatherIconToDisplay = "weather+nt_tstorms.png"
      WeatherIconLabel = "ThunderStorm"
   if "Clear" in ShortNightForecast:
      WeatherIconToDisplay = "weather+nt_clear.png"
      WeatherIconLabel = "Clear"
   indigo.variable.updateValue("WeatherConditionShortWord2", value=unicode("Low {}".format(forecastLowTemp)))
   indigo.variable.updateValue("WeatherDisplayIcon", value=unicode(WeatherIconToDisplay))
   indigo.variable.updateValue("WeatherDisplayIconLabel", value=unicode(WeatherIconLabel))

else:
#WeatherIconLabel = "HeatAlert"
   WeatherIconToDisplay = "weather+.png" #Defaults if not match is found
   WeatherIconLabel = "Unknown"
   if "Sunny" in ShortDayForecast or "Sun" in ShortDayForecast:
      WeatherIconToDisplay = "weather+sunny.png"
      WeatherIconLabel = "Sunny"
   if "Sunny" in ShortDayForecast and "Partially" in ShortDayForecast:
      WeatherIconToDisplay = "weather+partlysunny.png"
      WeatherIconLabel = "Clouds"
   if "sunny" in ShortDayForecast and "mostly" in ShortDayForecast:
      WeatherIconToDisplay = "weather+partlysunny.png"
      WeatherIconLabel = "Cloudly"
   if "Rain" in ShortDayForecast:
      WeatherIconToDisplay = "weather+rain.png"
      RainPercent = (indigo.variables["RainTonightProb"].value)
      WeatherIconLabel = "Rain {}%".format(RainPercent)
   if "Rain" in ShortDayForecast and "Sun" in ShortDayForecast:
      WeatherIconToDisplay = "weather+chancerain.png"
      WeatherIconLabel = "Showers {}%".format(RainPercent)
   if "Windy" in ShortDayForecast or "Wind" in ShortDayForecast:
      WeatherIconToDisplay = "weather+sunny.png"
      WeatherIconLabel = "Windy"
   if "Cloudy" in ShortDayForecast:
      WeatherIconToDisplay = "weather+cloudy.png"
      WeatherIconLabel = "Cloudy"
   if "Thunder" in ShortDayForecast:
      WeatherIconToDisplay = "weather+tstorms.png"
      WeatherIconLabel = "ThunderStorm"
   if "Overcast" in ShortDayForecast:
      WeatherIconToDisplay = "weather+overcast.png"
      WeatherIconLabel = "Overcast"
   if "Clear" in ShortDayForecast:
      WeatherIconToDisplay = "weather+sunny.png"
      WeatherIconLabel = "Sunny"
   if "Hot" in ShortDayForecast:
      WeatherIconToDisplay = "weather+sunny.png"
      WeatherIconLabel = "HeatAlert"
   
## Update iPad Control Page Display Variables for Icon and Icon Label

indigo.variable.updateValue("WeatherDisplayIcon", value=unicode(WeatherIconToDisplay))
indigo.variable.updateValue("WeatherDisplayIconLabel", value=unicode(WeatherIconLabel))

Who is online

Users browsing this forum: No registered users and 2 guests