Getting started questions on Item binding declarations

Hi guessed,

New to OpenHAB…

I’ve followed the instructions here and I’ve been able to create a cut down version of the supplied demo that is able to extract the temperature off one of my devices (standard thermometer). :slight_smile: Great stuff!

What I’m struggling to get my head round at the moment is how the binding is obtained and defined for another one of my devices - this being a MySensor constructed device which is also a thermometer. Copy/pasting the working ‘item’ line from the .items file and changing the device ID is not enough (I changed the .sitemap as well).

Any pointers as to where I should be looking to determine the format of the binding for this device (and any device for that matter)? I did look under ‘develop apps’ within the Vera at the .xml files but couldn’t see anything obvious…

Thank you,

Nutz

Following on from my previous question above…

How do I go about checking that the binding definition below is correctly formatted/populated with the binding details of the MySensors device that I want to read the temperature from?

{mios="unit:house,device:46/urn:schemas-micasaverde-com:device:TemperatureSensor:1/CurrentTemperature"}

Thanks

Nutz

To get the bulk of my Items file, I put the openHAB MiOS Bridge code into [tt]TRACE[/tt] mode (OH/configurations/logback_debug.xml entry, see MiOS Doc section on “Logger”)

This emits a lot more output, so it shouldn’t be run for long periods of time.

Anyhow, it emits log entries like:

09:01:33.160 TRACE o.o.b.m.internal.MiosBinding[:506]- internalPropertyUpdate: NOT BOUND {mios="unit:house,device:382/service/urn:cd-jackson-com:serviceId:SystemMonitor/memoryCached"}, value=27976, bound 1 time(s)

These entries containing “[tt]NOT BOUND[/tt]” are in the general form of a Binding string, and represent the Potential binding information needed to complete the puzzle. You still need all the extra Item information (ItemType “description”) but it’s a start.

{mios="unit:house,device:382/service/urn:cd-jackson-com:serviceId:SystemMonitor/memoryCached"}

I have it on my list to create a complete Items file generator, but just haven’t got to it yet. I did attempt to use OH1.x facilities to integrate more directly with the “catalog” in Vera, but those functions didn’t net the desired solution (OH2.x has redone these)

Also, @Ap15e created a starter generator here:
http://wiki.micasaverde.com/index.php/OpenHAB

But I wanted one that generated the complete list, driven by the ServiceId/Variable list instead of DeviceType, since the latter will take maintenance to keep it complete over time.

[quote=“nutcracker, post:2, topic:185626”]Following on from my previous question above…

How do I go about checking that the binding definition below is correctly formatted/populated with the binding details of the MySensors device that I want to read the temperature from?

{mios="unit:house,device:46/urn:schemas-micasaverde-com:device:TemperatureSensor:1/CurrentTemperature"}

Thanks

Nutz[/quote]

That’s not a ServiceId String, but if they’re using the standard ServiceId string then it would look like:

urn:upnp-org:serviceId:TemperatureSensor1

For a DeviceId of “46”, you’d typically write a binding declaration like:

    ... {mios="unit:house,device:46/urn:upnp-org:serviceId:TemperatureSensor1/CurrentTemperature"}

or use the short-hand version, given the internal aliases in the openHAB MiOS Binding:

    ... {mios="unit:house,device:46/Temperature/CurrentTemperature"}

You don’t have to use the ServiceId Aliases, since they’re optional/shorthand for a fully-specified ServiceId, but they make it less error-prone.

For reference, here is the current table of available/built-in ServiceId Aliases:
MiOS Binding · openhab/openhab1-addons Wiki · GitHub

guessed, thank you.

I tried both the examples you’ve provided but no luck. In fact, I can’t see any evidence of device 46 appearing in the list of ‘not bound’ devices that are listed. What I do see is this - could this cause the processing of devices to stop?

2015-01-26 17:23:53.180 [TRACE] [.o.b.mios.internal.MiosBinding] - internalPropertyUpdate: NOT BOUND {mios="unit:house,device:30/service/urn:upnp-org:serviceId:IPhoneLocator1/RootPrefix"}, value=(*)
2015-01-26 17:23:53.180 [TRACE] [.o.b.mios.internal.MiosBinding] - internalPropertyUpdate: NOT BOUND {mios="unit:house,device:30/service/urn:upnp-org:serviceId:IPhoneLocator1/LocationExtraInfo"}, value=GPS:50:false
2015-01-26 17:23:53.180 [DEBUG] [b.m.internal.MiosUnitConnector] - run: Exception Error occurred fetching content: For input string: "1422179878.218"
java.lang.NumberFormatException: For input string: "1422179878.218"
	at java.lang.NumberFormatException.forInputString(Unknown Source) ~[na:1.8.0_31]
	at java.lang.Integer.parseInt(Unknown Source) ~[na:1.8.0_31]
	at java.lang.Integer.parseInt(Unknown Source) ~[na:1.8.0_31]
	at org.openhab.binding.mios.internal.MiosUnitConnector$LongPoll.fixTimestamp(MiosUnitConnector.java:437) ~[na:na]
	at org.openhab.binding.mios.internal.MiosUnitConnector$LongPoll.processDevices(MiosUnitConnector.java:580) ~[na:na]
	at org.openhab.binding.mios.internal.MiosUnitConnector$LongPoll.processResponse(MiosUnitConnector.java:673) ~[na:na]
	at org.openhab.binding.mios.internal.MiosUnitConnector$LongPoll.run(MiosUnitConnector.java:743) ~[na:na]
	at java.lang.Thread.run(Unknown Source) [na:1.8.0_31]

update
Looks like 1422179878.218 is the LastUpdate field for the iPhoneLocator device (as reported within Vera for this plugin).

Thanks

Nutz

[quote=“nutcracker, post:5, topic:185626”]guessed, thank you.

I tried both the examples you’ve provided but no luck. In fact, I can’t see any evidence of device 46 appearing in the list of ‘not bound’ devices that are listed.[/quote]

Do you see it in the list of BOUND (case-sensitive) ones? If not, then you may not have the right logging level set (typically done by running the start_debug.xxx script, instead of start.xxx AND having the corresponding log file set to have TRACE level MiOS Logs (which isn’t the default for any of the logback*.xml files)

All Vera ServiceId/Variable values should appear in either the “[tt]BOUND[/tt]”, or “[tt]NOT BOUND[/tt]” lists.

What I do see is this - could this cause the processing of devices to stop?

2015-01-26 17:23:53.180 [TRACE] [.o.b.mios.internal.MiosBinding] - internalPropertyUpdate: NOT BOUND {mios="unit:house,device:30/service/urn:upnp-org:serviceId:IPhoneLocator1/RootPrefix"}, value=(*) 2015-01-26 17:23:53.180 [TRACE] [.o.b.mios.internal.MiosBinding] - internalPropertyUpdate: NOT BOUND {mios="unit:house,device:30/service/urn:upnp-org:serviceId:IPhoneLocator1/LocationExtraInfo"}, value=GPS:50:false 2015-01-26 17:23:53.180 [DEBUG] [b.m.internal.MiosUnitConnector] - run: Exception Error occurred fetching content: For input string: "1422179878.218" java.lang.NumberFormatException: For input string: "1422179878.218" at java.lang.NumberFormatException.forInputString(Unknown Source) ~[na:1.8.0_31] at java.lang.Integer.parseInt(Unknown Source) ~[na:1.8.0_31] at java.lang.Integer.parseInt(Unknown Source) ~[na:1.8.0_31] at org.openhab.binding.mios.internal.MiosUnitConnector$LongPoll.fixTimestamp(MiosUnitConnector.java:437) ~[na:na] at org.openhab.binding.mios.internal.MiosUnitConnector$LongPoll.processDevices(MiosUnitConnector.java:580) ~[na:na] at org.openhab.binding.mios.internal.MiosUnitConnector$LongPoll.processResponse(MiosUnitConnector.java:673) ~[na:na] at org.openhab.binding.mios.internal.MiosUnitConnector$LongPoll.run(MiosUnitConnector.java:743) ~[na:na] at java.lang.Thread.run(Unknown Source) [na:1.8.0_31]

It’s quite possible that the code needs to be more guarded when these conversions can’t take place.

From the above stack, it looks like the iPhone locator Plugin has a bug in it. Epoch timestamps in Vera, like the one listed above, are supposed to be a Long-value, not a Float-value.

For some reason, the iPhone Locator Plugin is putting a float into one of the internal Epoch timestamp fields.

If you’re running the 1.7.x MiOS Binding codebase, change the Item to use “String” instead of “DateTime” and that part will load. In the 1.7.x codebase, I only convert IF you’ve bound it to a DateTime Item-type OR if it’s one of the internal “System” fields supplied only by Vera (TimeStamp, Timestamp, DeviceSync, LoadTime, zwave_heal, time_created)

Hi guessed,

Yes I’m only running the debug version (1.6 version as per your wiki/docs). It appears that when it hit the exception it stopped processing any further devices. I have managed to work around this by changing the LastUpdate field to a 1 for this device.

A restart of OpenHAB and the device binding info for device 46 appears as you described it earlier - quick mod to my items file and I can now see the temperature for my MySensors device! :slight_smile: ;D :slight_smile:

Thank you!

Nutz