Hi Team,
I need a bit of help putting it all together.
Task: Update the string item state from the shared google sheets cell over myopenhab cloud.
Here is the script for Google:
function SendNewsUpdate() {
// Get the string item from Cell B3
var dop_tablets_news1 = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("oh-tablets").getRange("B3").getValue();
// Send Email - only for tests
var emailAddress = 'email@email.com'
var message = 'News update: ' + dop_tablets_news1;
var subject = 'Update from dop-tablets';
MailApp.sendEmail(emailAddress, subject, message);
var url = 'https://email%40email.com:password@home.myopenhab.org/rest/items/tablets_news';
var command = {
'method' : 'POST',
'payload': dop_tablets_news1,
};
return UrlFetchApp.fetch(url,command)
Logger.log(response.getContentText());
}
I get the following error:
Login information disallowed: https://email%40email.com:password@home.myopenhab.org/rest/items/tablets_news (line 16, file "Code")
Can anyone help please?
Sasha