This afternoon I migrated from 3.3.0M3 to 3.3.0M4. After migrating, when OpenHAB restarted there was an error in the log for a rule (when I can I will check the log history and insert it here).
When I looked at the rule in the UI, there is nothing in script when I click on it. The rule in question was created using Blockly and included the time comparison from the Marketplace Date and Time Blockly Automation Tookbox.
When I looked in the Automation, the Date and Time extensions showed as ADD (and not remove).
I tired to add it and get this message: “Installation of add-on marketplace:131329 failed.”
I tried to add another Blockly extension from the Marketplace and it also generated an error (same error except a different number).
I will mention this on the 3.3.0 Milestones thread, but am starting this so I can add more and not clutter up that thread.
J-N-K
(Jan N. Klug)
May 2, 2022, 5:25am
2
Any other related log messages?
Here is the rule error message:
(The rule worked and displayed in Blockly before I migrated).
2022-05-02 08:00:27.237 [ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID 'CombineGeorgePhoneLocation' failed: TypeError: (itemRegistry.getItem("MidwayGeorgesiPhoneiPhone13Pro_ItemGeorgesiPhoneiPhone13Pro_LastLocationUpdate").getState()).getZonedDateTime is not a function in <eval> at line number 38
And here is the code from the Rule UI. The code is now there, but nothing displays for Blockly.
configuration: {}
triggers:
- id: "1"
configuration:
itemName: GeorgesiPhoneiPhone13Pro_Location
type: core.ItemStateUpdateTrigger
- id: "2"
configuration:
itemName: MidwayGeorgesiPhoneiPhone13Pro_ItemGeorgesiPhoneiPhone13Pro_Location
type: core.ItemStateUpdateTrigger
conditions: []
actions:
- inputs: {}
id: "3"
configuration:
blockSource: '<xml xmlns="https://developers.google.com/blockly/xml"><block
type="oh_log" id="-O#)#$LP+71~5(S.@:x{" x="59" y="90"><field
name="severity">info</field><value name="message"><shadow type="text"
id="_/tG^%_Q*Nv#YS!HZyO$"><field name="TEXT">abc</field></shadow><block
type="text_join" id=":,)SQi]w@$XNSKJ][-ZW"><mutation
items="4"></mutation><value name="ADD0"><block type="text"
id="}y@CUIk]72-*zNke@6O%"><field name="TEXT">Spring:
</field></block></value><value name="ADD1"><block
type="deibich:blockly:dateTime_get_zdt_from_oh_item"
id="y*(3-u9%(!VjI_gPg*VD"><value name="ITEM"><shadow type="oh_item"
id="r@:aQT^7sYZeqBn1@#J-"><field
name="itemName">GeorgesiPhoneiPhone13Pro_LastLocationUpdate</field></shadow></value></block></value><value
name="ADD2"><block type="text" id=";]w8:0-jYq?aBY6JyN!;"><field
name="TEXT"> Midway: </field></block></value><value name="ADD3"><block
type="deibich:blockly:dateTime_get_zdt_from_oh_item"
id="0Yg-DuBS(?u($j5B6Y/E"><value name="ITEM"><shadow type="oh_item"
id="OmQ-82Wl#0,JuE-o;z!w"><field
name="itemName">MidwayGeorgesiPhoneiPhone13Pro_ItemGeorgesiPhoneiPhone13Pro_LastLocationUpdate</field></shadow></value></block></value></block></value><next><block
type="controls_if" id="nNUNvsA_yhY^{*~FEpYJ"><mutation
else="1"></mutation><value name="IF0"><block
type="deibich:blockly:dateTime_compare_zdt_with_zdt"
id="{ipE%c1MpzF{%L#.ohKN"><field name="COMPAREOP">After</field><field
name="COMP_DATETIME">dateandtime</field><field
name="PRECISION">seconds</field><value name="DATE1"><shadow
type="oh_zdt" id="q_QX5i$RN@3.?+YzzUbq"><field
name="day">2022-03-03</field></shadow><block
type="deibich:blockly:dateTime_get_zdt_from_oh_item"
id="pA[*5#Ta5YZkpEv2RJso"><value name="ITEM"><shadow type="oh_item"
id="*2#r_HQtc!a*{$0R1#dS"><field
name="itemName">GeorgesiPhoneiPhone13Pro_LastLocationUpdate</field></shadow></value></block></value><value
name="DATE2"><shadow type="oh_zdt" id="hmuOYwrJI59.:mXgI]wZ"><field
name="day">2022-03-03</field></shadow><block
type="deibich:blockly:dateTime_get_zdt_from_oh_item"
id="I$vrQM4A?GUm@1E!1O;X"><value name="ITEM"><shadow type="oh_item"
id="6J^w)S_//02rF!yX!gLE"><field
name="itemName">MidwayGeorgesiPhoneiPhone13Pro_ItemGeorgesiPhoneiPhone13Pro_LastLocationUpdate</field></shadow></value></block></value></block></value><statement
name="DO0"><block type="oh_event" id="$w0]v2=SMeeHkM:62=%h"><field
name="eventType">sendCommand</field><value name="value"><shadow
type="text" id="1#*D%U(QMte/tl.nyG6!"><field
name="TEXT">value</field></shadow><block type="oh_getitem_state"
id="_a9g4t_bPI}b^-p5fts="><value name="itemName"><shadow type="oh_item"
id=")Lg*bjbYudPz]3@C34k`"><field
name="itemName">GeorgesiPhoneiPhone13Pro_Location</field></shadow></value></block></value><value
name="itemName"><shadow type="oh_item" id=")Gs[5cYHL8?@,vSNZYNM"><field
name="itemName">GeorgePhoneLocation</field></shadow></value><next><block
type="oh_event" id="I0*xD5uX/(;kFm`!%3+1"><field
name="eventType">sendCommand</field><value name="value"><shadow
type="text"><field name="TEXT">value</field></shadow><block type="text"
id="O!7;B^{:AB#k}4bxHang"><field
name="TEXT">Spring</field></block></value><value name="itemName"><shadow
type="oh_item" id="kmg:Ve`G5~ety_!deOH3"><field
name="itemName">GeorgeiPhoneLocationSource</field></shadow></value></block></next></block></statement><statement
name="ELSE"><block type="oh_event" id="tr8ra^j4wdOzZF!F{RPt"><field
name="eventType">sendCommand</field><value name="value"><shadow
type="text"><field name="TEXT">value</field></shadow><block
type="oh_getitem_state" id="G=/Z?@ALK.-wW||$E4w%"><value
name="itemName"><shadow type="oh_item" id="8#P!49EdciL:X~IBWX;2"><field
name="itemName">MidwayGeorgesiPhoneiPhone13Pro_ItemGeorgesiPhoneiPhone13Pro_Location</field></shadow></value></block></value><value
name="itemName"><shadow type="oh_item" id="pUG$pn1Y%tspU)@@Rb48"><field
name="itemName">GeorgePhoneLocation</field></shadow></value><next><block
type="oh_event" id="?P~W:L,^a19[:FCU=3k;"><field
name="eventType">sendCommand</field><value name="value"><shadow
type="text"><field name="TEXT">value</field></shadow><block type="text"
id="(y^q=H|P:kk[Ks}i_@PX"><field
name="TEXT">Midway</field></block></value><value name="itemName"><shadow
type="oh_item" id="H]Tic^~JLerwKnbQg,pR"><field
name="itemName">GeorgeiPhoneLocationSource</field></shadow></value></block></next></block></statement></block></next></block></xml>'
type: application/javascript
script: >
var logger =
Java.type('org.slf4j.LoggerFactory').getLogger('org.openhab.rule.' +
ctx.ruleUID);
function deibich_blockly_compare_zdt_with_precision(date1, date2, compareOp, precision, compDate) {
switch (precision) {
case 'years':
date2 = date2.withMonth(date1.getMonthValue());
case 'months':
date2 = date2.withDayOfMonth(date1.getDayOfMonth());
case 'days':
date2 = date2.withHour(date1.getHour());
case 'hours':
date2 = date2.withMinute(date1.getMinute());
case 'minutes':
date2 = date2.withSecond(date1.getSecond());
case 'seconds':
date2 = date2.withNano(date1.getNano());
}
if(compDate === 'date') {
date1 = date1.toLocalDate();
date2 = date2.toLocalDate();
} else if(compDate === 'time')
{
date1 = date1.toLocalTime();
date2 = date2.toLocalTime();
}
switch (compareOp) {
case 'Before':
return date1.isBefore(date2);
case 'After':
return date1.isAfter(date2);
case 'Equal':
return date1.isEqual(date2);
}
}
logger.info((['Spring: ',itemRegistry.getItem('GeorgesiPhoneiPhone13Pro_LastLocationUpdate').getState().getZonedDateTime(),' Midway: ',itemRegistry.getItem('MidwayGeorgesiPhoneiPhone13Pro_ItemGeorgesiPhoneiPhone13Pro_LastLocationUpdate').getState().getZonedDateTime()].join('')));
if (deibich_blockly_compare_zdt_with_precision(itemRegistry.getItem('GeorgesiPhoneiPhone13Pro_LastLocationUpdate').getState().getZonedDateTime(), itemRegistry.getItem('MidwayGeorgesiPhoneiPhone13Pro_ItemGeorgesiPhoneiPhone13Pro_LastLocationUpdate').getState().getZonedDateTime(), 'After', 'seconds', 'dateandtime')) {
events.sendCommand('GeorgePhoneLocation', itemRegistry.getItem('GeorgesiPhoneiPhone13Pro_Location').getState());
events.sendCommand('GeorgeiPhoneLocationSource', 'Spring');
} else {
events.sendCommand('GeorgePhoneLocation', itemRegistry.getItem('MidwayGeorgesiPhoneiPhone13Pro_ItemGeorgesiPhoneiPhone13Pro_Location').getState());
events.sendCommand('GeorgeiPhoneLocationSource', 'Midway');
}
type: script.ScriptAction
Not that I can see, though perhaps there are more logs I should be looking at than the openhab and events logs.
There is a Warning when it first restarts:
2022-05-01 19:06:57.927 [INFO ] [.core.internal.i18n.I18nProviderImpl] - Time zone set to 'America/Chicago'.
2022-05-01 19:06:57.968 [INFO ] [.core.internal.i18n.I18nProviderImpl] - Location set to '30.093914214693438,-95.33740282058717'.
2022-05-01 19:06:57.971 [INFO ] [.core.internal.i18n.I18nProviderImpl] - Locale set to 'en_US'.
2022-05-01 19:07:02.211 [WARN ] [.transport.servlet.ServletController] - Can't find the request for http://openhab:8080/rest/events's Observer
2022-05-01 19:07:06.386 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'presence_groups.items'
But seems unrelated.
There are also two Tuya Things that were working perfectly every time that are now showing as offline and disabling/enabling doesn’t bring them back online, and adding the IP address to the configuration doesn’t help. I have opened an issue on GitHub related to this latter issue Tuya Things Not Connecting after migration to openHAB 3.3.0M4 · Issue #363 · smarthomej/addons · GitHub
J-N-K
(Jan N. Klug)
May 2, 2022, 5:41pm
5
This seems to be the same problem like the HABPanel one.
I was able to resolve the Tuya Thing issue by removing the device from Smart Life and then adding it back (I first deleted the Thing in openHAB than created a new one from the Thing inbox and relinked the Items to the channels.
This problem was fixed in openHAB 3.3.0-M5