openhab / openhab-addons

Add-ons for openHAB
https://www.openhab.org/
Eclipse Public License 2.0
1.86k stars 3.57k forks source link

[homematic] Can't convert type DecimalType with value '3000.0' to FLOAT value with QuantityTypeConverter #4611

Closed real-easy closed 5 years ago

real-easy commented 5 years ago

hello,

i try in english but, its not so good (im german..).

since i update my OH from an 2.4 snapshot (2.4.0.201811021724) to the 2.4 stable i had an problem with my analog output. now i tested the last 2.5 snapshoot there is still the same problem.

i read something about this problem with setting temperatures, but i have not an problem with the termperatures. may be this is already fixed.

i think its an problem with the homematic binding.

my hardware is an wired homematic io modul (HMW-IO-12-Sw14-DR). here is one output configured as analog. the value must be set as frequency.

in paper-ui looks like this: homematic:HMW-IO-12-Sw14-DR:ccu240:NEQxxxxxxx:7#FREQUENCY

if i try to set the frequency to an vale i get an error message like this:

[WARN ] [ematic.handler.HomematicThingHandler] - Can't convert type DecimalType with value '3000' to FLOAT value with QuantityTypeConverter for 'NEQ0308230:7#FREQUENCY', please check the item type and the commands in your scripts

now i removed the fixed value in script an change to an float-variable. but i get the same error message:

[WARN ] [ematic.handler.HomematicThingHandler] - Can't convert type DecimalType with value '3000.0' to FLOAT value with QuantityTypeConverter for 'NEQ0308230:7#FREQUENCY', please check the item type and the commands in your scripts

if i try to set the value in the homematic gateay, there is no problem.

but by the way the value for the frequency still is only an integer in range from 0 to 65535 in the homematic gateway, not an float.

bevore the update to the 2.4.0 stable this was never a problem. i dont change the script since the last 2 years.

can someone understand this ?

thx a lot...

wborn commented 5 years ago

Did you try deleting your Homematic Things and readding them? That seems to solve similar issues for some according to this community thread.

real-easy commented 5 years ago

thanks for answer...

my things are in an .thing file my items in a .item file. (like OH V1.8)

in my opinion it is not possible to add all the thing for a whole house every time again for a new version.

for my update i started the empty OH2.5.0 at first ime without the conf files. then i added the bindings (homematic, mqtt, mysql ...) with the paper UI. then i logged out and shutdown OH. now i copied my things, items, rules and config files in the conf folder. (i do this for the 2.4. stable and for the 2.5. snapshot, today.)

so i get all my things and items in OH without the discovery functionality of paper UI.

if i was right, then in this variant of config, it is not possible to delete the thing and re-add them. i think with this update method, OH will generate the things/items after adding the files new.

wborn commented 5 years ago

Perhaps your items/rules need some updates for the QuantityType changes. See also this community topic.

real-easy commented 5 years ago

i try this: var Number testval=3456 myitem.sendCommand((testval as QuantityType).doubleValue)

i get: [ERROR] [ntime.internal.engine.RuleEngineImpl] - Error during the execution of startup rule 'rulename': Could not cast 3456 to org.eclipse.smarthome.core.library.types.QuantityType;

in my rule it is only set to fixed values: myitem.sendCommand(3000)

this is my item: Number myitem "myitem label [%d]" (gOG_BAD, gPers) {channel="homematic:HMW-IO-12-Sw14-DR:ccu2:NEQxxxxxxx:7#FREQUENCY"}

valid values are 1,2,3,4,5 ... 49999, 50000.

if i look at the item the values are set, but they are not send to the homematic-gateway (ccu) or the actor.

MHerbst commented 5 years ago

The Homematic binding has moved to the Eclipse Smarthome repo https://github.com/eclipse/smarthome . It's therefore better to create an issue in the Smarthome repo and close this issue here.

real-easy commented 5 years ago

ok, i do this, thx

real-easy commented 5 years ago

after this answer i reopen this issue...

No... ESH is no longer maintained. You'll find the homematic binding here... https://github.com/openhab/openhab2-addons/issues.

in between i do some updates... (https://github.com/eclipse/smarthome/issues/6868)

now im at build 1549 an the problem is still there :(

(ps: on all updates i remove all my things ...)

wborn commented 5 years ago

Yes we moved all ESH code back to the openHAB repositories. So you can create Homematic Binding issues here again. Kai wrote about this in an announcement. Sorry for all the troubles @real-easy!

J-N-K commented 5 years ago

Try Number:Frequency as item type. And var Number testVal = 500|Hz in your rule.

real-easy commented 5 years ago

i changed my item to the Number:Frequency type. then i test with this:

        var Number fred=3|Hz
        xxxxxxxxxxx.sendCommand(fred)

an it works. yeah! (thanks....) great where can i read abaout this function.

BUT!

i send 3Hz to the item, and i can see this on the sitemap ... after an datapoint update homatic -> openhab ... the value in the changes from 3 to 3000. because the homematic item works with mHz (milli-herz).

if i try this:

        var Number fred=1.5|Hz
        xxxxxxxxxxx.sendCommand(fred)

in the item only comes 1Hz (or afer HM update 1000mHz). it is possible to sen float values ?

J-N-K commented 5 years ago

The Unit should be displayed, too. Try changing the label to [%d mHz] (not sure if that works, maybe mHz is not defined. If Hz is better anyway, just use [%.2f Hz], the conversion from mHz to Hz is done by the framework.

This is documented here:https://www.openhab.org/docs/concepts/units-of-measurement.html

If the fractional part is lost during conversion, that sounds like a bug. Was 1500 working before?

real-easy commented 5 years ago

yes the 1500 works before... (also 1 mHz works = 0.001 Hz)

and now with the [%.2f Hz] it works too, thanks. after flying over the "units-of-measurement" i try with [%d mHz] -> it clearly works too.

danke und beste grüße nach gelsenkirchen ...