Highest and lowest outdoors temperature during day

Run that inspecting “Living Room” (the SONOS speaker) and it returned:

Device:	 Living Room 
Zone:	 undefined
ID:	 5de31c51-771b-46e7-9ed1-5699e9ab8ed9 
Capabilities: speaker_album,speaker_artist,speaker_duration,speaker_next,speaker_playing,speaker_position,speaker_prev,speaker_repeat,volume_set,volume_mute,speaker_shuffle,speaker_track,sonos_group,sonos_line_in,sonos_audio_clip

I see that i .zoneName is not avalable, but
image
.zone is (returns the zone’s ID)

Thanks again, Peter_Kawa. Another tool in the box :slight_smile: :+1:
(I have a HP2019 at home, so this will all come to use :- )

1 Like

Ah, same here

but, on my Pro2019 it returns the zone name anyways when i use i.zoneName :blush:

And YW.

Find Zone name:

// Find a zone name, argument = zone ID, text-tag returns name

//let zoneID = args[0]
let zoneID = "855113f1-f488-4223-b675-2f01270f573e"

const myZones = await Homey.zones.getZones();
for (var iMyZone in myZones){
  if (myZones[iMyZone].id == zoneID) {
  log(`Zone name of zone [${myZones[iMyZone].id}]: ${myZones[iMyZone].name}`);
  return(myZones[iMyZone].name);
  }
}



1 Like

While waiting for the script to start running, I’ve of course accomplished what I set out to do by the use of advanced flow :smile:. Here’s how I solved it:

But as I’m on a serious learning curve, I would like to get the script running as well…

1 Like

Hi, I had the same issue and I think I figured it out. The ID for the log has to also include the ID for the device, the Insights link for that measurement hinted to that. So that “let entries” line becomes this:

let entries = await Homey.insights.getLogEntries({uri: "homey:device:e9e57bbd-9181-4396-b41f-47d875de4d03", id: "homey:device:e9e57bbd-9181-4396-b41f-47d875de4d03:measure_temperature", resolution: "last24Hours"});

Seems like a weird thing, but it atleast works now.
Thanks for all the coding help :smiley:

1 Like