Actions with same ServiceType but different ServiceID doesn't work

I’m writing a plugin for RCS RS485 thermostats and I have the following actions defined in my I_ file:

<action>
  <serviceId>urn:upnp-org:serviceId:TemperatureSetpoint1Heat</serviceId>
  <name>SetCurrentSetpoint</name>
  <run>
    luup.log(lul_device .. " " .. lul_settings.NewCurrentSetpoint)
    send_command(lul_device, "SPH=" .. lul_settings.NewCurrentSetpoint)
  </run>
</action>
<action>
  <serviceId>urn:upnp-org:serviceId:TemperatureSetpoint1Cool</serviceId>
  <name>SetCurrentSetpoint</name>
  <run>
    send_command(lul_device, "SPC=" .. lul_settings.NewCurrentSetpoint)
  </run>
</action>

However, when loading the Luup engine, it seems to have produced the following Lua code:

function STemperatureSetpoint1_SetCurrentSetpoint_run(lul_device,lul_settings)

    luup.log(lul_device .. " " .. lul_settings.NewCurrentSetpoint)
    send_command(lul_device, "SPH=" .. lul_settings.NewCurrentSetpoint)

end
function STemperatureSetpoint1_SetCurrentSetpoint_run(lul_device,lul_settings)

    send_command(lul_device, "SPC=" .. lul_settings.NewCurrentSetpoint)

end

As you can see, the function names are the same. Now no mater what ServiceID I use to execute the action, only the last function is called. Is this a bug or am I missing something?

I’m using a Vera2 with 1.1.1047

Thanks

According to http://wiki.micasaverde.com/index.php/Luup_UPNP_Files the service ids are

#define HVACHEAT_SID    "urn:upnp-org:serviceId:TemperatureSetpoint1_Heat"
#define HVACCOOL_SID    "urn:upnp-org:serviceId:TemperatureSetpoint1_Cool"

I don’t know whether the missing _ is related to your problem. BTW, I cannot find these service ids in the official UPnP specifications …

Thanks for the reply! I tried it with the underscore first since I took it from D_HVAC_ZoneThermostat1.xml but I took it off because I thought that might be causing the problem. I thought the ServiceID could be any URN that uniquely describe the service so it doesn’t have to be from the UPnP specs?

I thought the ServiceID could be any URN that uniquely describe the service so it doesn't have to be from the UPnP specs?

You are right, but the service ID must not/should not start with upnp-org if the service ID is not defined by the UPnP Forum.

If you look at the name of the generated action function:

function STemperatureSetpoint1_SetCurrentSetpoint_run(lul_device,lul_settings)

Luup seems to generate the name using the ServiceType, Action, and Action tag (run, job, etc…) The ServiceID is not actually part of the function name at all. Since UPnP allows more than one service of the same type but with different IDs, this seems like a bug to me.

Have anyone else ran into this problem? Can anyone verify? How is this working for Z-Wave thermostats? This is blocking my plugin development. Any help would be greatly appreciated!

This has been solved in the latest beta build. The problem was that the function names were generated using the file name as a prefix. This problem occurred only when two services shared the same description file.