Virtual Thermostat mapped I/O

I am working on a new plugin to be used with the X-300, One Wire Sensors, or any temperature sensor.
The thermostat maps in a temperature sensor reading and then maps out to a standard binary switch…any switches.
I have noticed that I am able to use .1 accuracy on the current temperature as well as the set points. Based on the set points the thermostat turns the switch on or off as needed.

This virtual thermostat will allow others to control devices based on temperature without creating any code or scenes.

Question: I know the Vera uses (i4) values for all of these variables…does it matter in my case since I am using my implementation file to intercept all actions?

@Guessed…what do you think?

Regards
Tim Alls

In the case below the temperature sensor “Channel 1” is mapped to feed the current temperature and the relay 1 is mapped to accept the output commands…timer updates every 30 seconds
AllSeas Yachts

Question: I know the Vera uses (i4) values for all of these variables.....does it matter in my case since I am using my implementation file to intercept all actions?

AFAIK, it shouldn’t matter as long as you aren’t providing Luup triggers/events ([tt]“comparisson”[/tt]) whose resolution is limited to integer values.

BTW, in MiOS, all temperatures and all setpoints (and other items?) are wrongly implemented as integer degrees, whereas the UPnP specification requires the unit of measure to be centidegrees.

[quote=“Ap15e, post:2, topic:170728”]

Question: I know the Vera uses (i4) values for all of these variables…does it matter in my case since I am using my implementation file to intercept all actions?

AFAIK, it shouldn’t matter as long as you aren’t providing Luup triggers/events ([tt]“comparisson”[/tt]) whose resolution is limited to integer values.

BTW, in MiOS, temperatures and setpoints (and other items?) are wrongly implemented as integer degrees, whereas the UPnP specification requires the unit of measure to be centidegrees.[/quote]
Thanks for the response,
Bad idea to limit it to integers!

Thanks
Tim

Another Question…
I used the virtual thermostat as a template for this plugin…there was no implementation for the right hand drop down box…anyone know what service goes with that box…I am assuming it is fan control…is that correct? It is hard to identify being that I wasn’t trained in the Json Art! :slight_smile:
Regards
Tim

[tt]“urn:upnp-org:serviceId:HVAC_FanOperatingMode1” / “ModeStatus”[/tt] - a non-standard state variable … Required state variables are [tt]Mode[/tt] and [tt]FanStatus[/tt].

Thanks @Ap15e,
There is something strange going on with my json file for the HVAC…perhaps this is an old bug, this is a clip from the json file:

        "FanMode": {
            "Style": "numeric",
            "Service": "urn:upnp-org: serviceId: HVAC_FanOperatingMode1",
            "Variable": "ModeStatus"

There are some spaces in the urn: that are making the action give a “no implementation error”.
I will dig a little deeper…this unit was reset to factory settings several time due to my fantastic programming skills ;D …haha

Regards
Tim

Excerpt from my [tt]D_HVAC_ZoneThermostat1.json[/tt] / Vera V1@1.1.1338:

"FanMode": {
                "Style": "numeric",
                "Service": "urn: upnp-org: serviceId: HVAC_FanOperatingMode1",
                "Variable": "ModeStatus" 
            } 

[quote=“Ap15e, post:7, topic:170728”]Excerpt from my [tt]D_HVAC_ZoneThermostat1.json[/tt] / Vera V1@1.1.1338:

"FanMode": { "Style": "numeric", "Service": "urn: upnp-org: serviceId: HVAC_FanOperatingMode1", "Variable": "ModeStatus" } [/quote]

Well I see spaces in yours as well and yours functions…correct?
I get a no implementation error…I will study the implementation file and see if I can locate the problem…
This came from the virtual devices created by MCV ! ???

Regards
Tim

Excerpt from my V2@1.5.322:

 "FanMode": {
                "Style": "numeric",
                "Service": "urn: upnp-org: serviceId: HVAC_FanOperatingMode1",
                "Variable": "ModeStatus"
            }

The same wrong service id.

[quote=“Ap15e, post:9, topic:170728”]Excerpt from my V2@1.5.322:

 "FanMode": {
                "Style": "numeric",
                "Service": "urn: upnp-org: serviceId: HVAC_FanOperatingMode1",
                "Variable": "ModeStatus"
            }

The same wrong service id.[/quote]
Well it’s not just me then…
Thanks for checking.
When I eliminate the spaces and upload it to Vera the UI display adds a new energy box and the temperature settings are gone. Maybe I need to switch to a different thermostat file.???

Tim

Here is the error in the log:

08 03/01/12 15:57:37.641 JobHandler_LuaUPnP::HandleActionRequest device: 13 service: urn:micasaverde-com:serviceId:HaDevice1 action: ToggleState <0x2c0c>
02 03/01/12 15:57:37.642 Device_LuaUPnP::HandleActionRequest 13 none of the 1 implementations handled it <0x2c0c>

Here is the action list in the implementation file: (there is no ToggleState which is my problem right???)

<startup>virtual_thermostat_startup</startup>
	<actionList>
		<action>
			<serviceId>urn:upnp-org:serviceId:HVAC_UserOperatingMode1</serviceId>
			<name>SetModeTarget</name>
			<job>
				luup.variable_set ("urn:upnp-org:serviceId:HVAC_UserOperatingMode1", "ModeTarget", lul_settings.NewModeTarget, lul_device)
				luup.variable_set ("urn:upnp-org:serviceId:HVAC_UserOperatingMode1", "ModeStatus", lul_settings.NewModeTarget, lul_device)
				updateStatus()
				return 4, 5
			</job>
		</action>
		<action>
			<serviceId>urn:upnp-org:serviceId:TemperatureSetpoint1_Heat</serviceId>
			<name>SetCurrentSetpoint</name>
			<job>
				luup.variable_set ("urn:upnp-org:serviceId:TemperatureSetpoint1_Heat", "CurrentSetpoint", lul_settings.NewCurrentSetpoint, lul_device)
				updateStatus()
				return 4, 5
			</job>
		</action>
		<action>
			<serviceId>urn:upnp-org:serviceId:TemperatureSetpoint1_Cool</serviceId>
			<name>SetCurrentSetpoint</name>
			<job>
				luup.variable_set ("urn:upnp-org:serviceId:TemperatureSetpoint1_Cool", "CurrentSetpoint", lul_settings.NewCurrentSetpoint, lul_device)
				updateStatus()
				return 4, 5
			</job>
		</action>
		<action>
			<serviceId>urn:upnp-org:serviceId:HVAC_FanOperatingMode1</serviceId>
			<name>SetMode</name>
			<job>
				luup.variable_set ("urn:upnp-org:serviceId:HVAC_FanOperatingMode1", "Mode", lul_settings.NewMode, lul_device)
				updateStatus()
				return 4, 5
			</job>
		</action>
		<action>
			<serviceId>urn:upnp-org:serviceId:SwitchPower1</serviceId>
			<name>SetTarget</name>
			<job>
				luup.variable_set ("urn:upnp-org:serviceId:SwitchPower1", "Target", lul_settings.newTargetValue, lul_device)
				luup.variable_set ("urn:upnp-org:serviceId:SwitchPower1", "Status", lul_settings.newTargetValue, lul_device)
				return 4, 5
			</job>
		</action>
	</actionList>

???
Tim

Hello TimAlls

How are you progressing with your virtual thermostat? I am very interested in this project. I installed an HVAC app some 18 months ago with a fair bit of Luup code but I consider myself to still be a novice in these things.

I have recently moved to UI5 which was not straightforward but all now working sufficiently well such that I am now looking to develop the system further.

I am using 3-in-1 temp sensors and handling setpoints via some home grown Luup code (i.e. no hardwired thermostat) and am now looking to provide an option for the room occupant to vary the setpoint via SQ Remote on an ipod touch.

Your virtual device is almost exactly what I am looking for.

Thanks in anticipation.

terencec