Today has been a day of mixed fortunes. JASM called to say the alternator was fixed, he'd replaced the pulley, bearings, regulator and brushes and cleaned the shell up. I went and collected the alternator before a work call.

Refitting the alternator was easy, sorting the belt out was a mega hassle but was eventually overcome with the help of the routing diagram that the previous owner helpfully left in the glovebox. With that refitted and the belt tensioned I could refit the inlet manifold and throttle body as well as air inlet/filter arrangement and connect up the plugs for the various sensors. I jumped into the driver seat, full of glee and turned the key

After a few coughs it started up and settled to an 1100rpm idle. FLIPPING YES!
My joy was, as usual, short lived. I gave the accelerator a few blips and it settled again, only this time the idle was higher. about 1500rpm. I left it to warm up and the idle rose again, to approx 1800rpm. Bumhats. Time to plug it in then. On the plus side, the alternator was way quieter than it was previously so thats a step in the right direction.
I got the OBD2 reader/diagnostic laptop hooked up andstarted to try and work out what was wrong. I began by getting it to output live data from all the sensors I could think might be involved in this malarkey. There are others which I could get data from if required. The below is with the engine running, idling at ~1800rpm with the engine up to temp on the gauge

What jumped out to me is that oxygen sensor S1 has a voltage of zero, and a short term fuel trim of zero. Whereas sensor S2 had a voltage of between 0.1v and 1v and a short term fuel trim of between 25.0 and 26.2. This suggested to me that sensor 1 might be dead or unplugged?

Graphing the data showed it to be resolutely at 0 for both readings. I compared this with live readings for S2 below

I left it idle for a bit and fiddled with buttons, with the AC turned on, the idle dropped to a steady 1500rpm, but on turning the AC off, the idle started to hunt about, rising to approx 1900rpm, then stuttering and dropping to 1000rpm before repeating at ~3 second intervals. Turning the AC back on stopped this hunting and the idle returned to 1500rpm steady.
I got out, and with the engine still running squirted brake cleaner about with zero effect, other than when I squirted it directly down the air intake which (predictably) caused the idle to drop then recover, so I don't think I had an air leak.
Finally, I read the fault codes. I had cleared these the other day and the car was only started tonight so these are 'new' codes

This tells me O2 sensor S1 is slow to respond/not responding - corroborating the earlier suggestion that S1 is kippered. I assumed Sensor S1 its in the manifold downpipe, pre catalytic converter Secondly, there are many available on ebay (helpfully the engine is largely a Toyota 2SZ-FE as fitted to the Mk1 Toyota Yaris among others) - they don't state of they are S1 or S2, or was I being stupid and they are the same, and the computer works something out based on the difference between reading 1 and reading 2, except on my car it can't because there is no reading 1?
After a helpful suggestion from my brother, I swapped the two lambda sensors over and fired it up, the revs rose slowly to 1500 again, but on reading the data I was now getting voltage readings at both sensors.
Since the sensors are not new - they seem to be marked with metallic purple paint suggesting they are secondhand - I have opted to buy one brand new replacement with a view to fitting it in the first/precat position in the manifold. A genuine delphi unit is £60, but a blueprint one was only £22 so I've gone with that.
Some multimeter bingo suggests that the loom side of the precat sensor is fine, I get 12v across the pins for heater and ground, and a continuity reading across ground and sensor so I am optimistic that works and its sensor-side thats not happy. The S1 sensor was still not giving a short term fuel trim reading, despite having a voltage of 0.05v which is interesting/annoying and the fault codes returned suggesting the S1 was slow responding.
The precat sensor was quite sooty, suggesting its running rich, which I'm also taking to mean it needs the O2 readings sorting out so it can fuel appropriately. Apparently Daihatsus of this generation have an appetite for O2 sensors generally, and who knows how long these two have been on the car that donated them?
I'd read that the Idle Control Valves in the throttle bodies can gum up too, but its not clear what the symptoms of this might be. I'm thwarted in this respect because the ICV bit of the throttle body is held on with 2x 'safety' torx screws - they have 5 lobes, not the usual 6. I don't have a set of these, but ordered some as you can never have too many specialised tools
I had a spare throttle body unit with the car, so I tried swapping them over, to no effect - behaviour was identical. I find it unlikely that two totally separate throttle bodies might have utterly kippered ICVs. Its a Denso part, shared with Mk1 Yarises, Daihatsu YRVs, Copens and several other cars, I suppose its POSSIBLE that both ICVs are kaputt but seems unlikely, especially as the symptoms are identical.