• Operation on VMware virtual PCs

    2
    0 Votes
    2 Posts
    516 Views
    RussR
    @hondaru2004, here's a powershell script that will create a new computer in your TRIGGERcmd account. It assumes you installed the agent on the master PC you cloned because it uses the token.tkn file from that install for authentication. It writes the computer ID and computer name to the config files in the user's home directory. I hope this helps. # === Configuration === $urlprefix = "https://triggercmd.com" $computername = $env:COMPUTERNAME # Read token from TRIGGERcmd token file $tokenPath = Join-Path $env:USERPROFILE ".TRIGGERcmdData\token.tkn" if (Test-Path $tokenPath) { $token = Get-Content $tokenPath -Raw | ForEach-Object { $_.Trim() } Write-Host "Token loaded from: $tokenPath" -ForegroundColor Green } else { Write-Host "Error: Token file not found at $tokenPath" -ForegroundColor Red Read-Host "Press Enter to exit" exit 1 } # === Perform the POST request === Write-Host "Making API request..." -ForegroundColor Green $headers = @{ "Authorization" = "Bearer $token" "Content-Type" = "application/x-www-form-urlencoded" } $body = "name=$computername" try { $response = Invoke-RestMethod -Uri "$urlprefix/api/computer/save" -Method POST -Headers $headers -Body $body # === Display the full response === Write-Host "`nAPI Response:" -ForegroundColor Yellow $response | ConvertTo-Json -Depth 10 | Write-Host # === Extract and save the ID === $computerId = $response.data.id if ($computerId) { # Save ID to TRIGGERcmd config file $computerIdPath = Join-Path $env:USERPROFILE ".TRIGGERcmdData\computerid.cfg" $computerNamePath = Join-Path $env:USERPROFILE ".TRIGGERcmdData\computername.cfg" # Ensure the directory exists $triggerCmdDir = Split-Path $computerIdPath -Parent if (!(Test-Path $triggerCmdDir)) { New-Item -ItemType Directory -Path $triggerCmdDir -Force | Out-Null } # Save ID to file $computerId | Out-File -FilePath $computerIdPath -Encoding ASCII -NoNewline # Save computer name to file $computername | Out-File -FilePath $computerNamePath -Encoding ASCII -NoNewline Write-Host "`nExtracted ID: $computerId" -ForegroundColor Cyan Write-Host "ID saved to: $computerIdPath" -ForegroundColor Green Write-Host "Computer name saved to: $computerNamePath" -ForegroundColor Green } else { Write-Host "`nError: Could not find ID in response" -ForegroundColor Red } } catch { Write-Host "`nError making API request:" -ForegroundColor Red Write-Host $_.Exception.Message -ForegroundColor Red } Write-Host "`nRequest completed." -ForegroundColor Green Run the script with a command like this: powershell -ExecutionPolicy Bypass -File .\change_tcmd_id.ps1 Or, you could just delete the computerid.cfg file and it will prompt you for the token like when you first install the agent.
  • MacOS - A JavaScript error occurred in the main process

    8
    1
    0 Votes
    8 Posts
    2k Views
    RussR
    @Simon thanks again for reporting the error. I'll see if I can reproduce it. It looks like it's in the Home Assistant integration. Sorry about the trouble. EDIT: I see from your screenshot that this.computer_name was null for some reason, so I added code to prevent a crash when that happens. I'll produce a new version soon. https://github.com/rvmey/TRIGGERcmd-Agent/commit/b54e988e7d251105bc6faa8c3fa6a5240644cbef EDIT2: Done - please upgrade to the current version (v1.0.52) to avoid that error in the future.
  • TriggerCMDAgent gives Errors when shutting down PC

    6
    0 Votes
    6 Posts
    2k Views
    RussR
    @Zaydel-Jiménez, please confirm, you're seeing the "A break point has been reached" error during Windows shutdown? If so, can you get a picture of that error like Furkan did, it might help me. Also, if it happens every time or only once in a while it would also help me to know that. I couldn't find the old 1.0.48 version but I don't think it will be any better in terms of that error than the latest version 1.0.50 because it contains the same code I thought would fix it. It's a tricky problem to fix because I can't reproduce it myself. FYI, these are the version notes: https://www.triggercmd.com/forum/topic/14/triggercmd-agent-versions
  • Can't Open Application

    2
    1
    0 Votes
    2 Posts
    843 Views
    RussR
    @garym77, does that command work from a Terminal window? You should run it there first so you can see if the command gives an error. Also, you should make the voice word something like creality so you can say "Alexa, turn on creality" after you enable the Triggercmd Smart Home skill.
  • Invoice for subscription

    2
    0 Votes
    2 Posts
    717 Views
    RussR
    @Stanisław-Grzybołowski I emailed you the PayPal transaction info. Hopefully that will serve as an invoice.
  • Monetizing Triggers?

    4
    0 Votes
    4 Posts
    1k Views
    RussR
    @Convaiyer, let's talk about it. I just sent you a PM.
  • app version for mac os yosemite

    3
    0 Votes
    3 Posts
    963 Views
    R
    @Russ unfortunaly no but thank you anyways. if you find and older one, ill give it a try [image: am0BhwWO_o.png]
  • Having issues with TC launching a batch

    2
    0 Votes
    2 Posts
    790 Views
    RussR
    @Strahan, I wonder if when the TC agent runs your batch file, the sql.exe file isn't in your PATH, so it doesn't run. The agent is probably running your batch file, which you've basically already proven with your loghealth.bat experiment. I like that you added another line to your laundryreset.bat file that writes something to a log file, but it's writing your log.txt file to the present working directory, which in the context of the TC agent is something like this: C:\Users\russ\AppData\Local\triggercmdagent\app-1.0.47\resources\app\src Assuming it is running your laundryreset script, you can probably fix this if you put the full path to your sql.exe file (and your log file) in the laundryreset.bat file, something like this: @echo off c:\full\path\sql.exe homecenter "delete from activeitems where action = 8192" /u service.triggercmd.homecenter /p (pwd) /h lioth.mydomain.com /l c:\logs\laundryreset.log echo From laundryreset.bat >> c:\logs\laundryreset.log dir >> c:\logs\laundryreset.log You'll want to remove the last 2 lines, especially the dir line, but I put it there because that can show you what the working directory is.
  • i want to cancel and request a refund

    4
    0 Votes
    4 Posts
    1k Views
    J
    Hi everyone, I’m new here and happy to join the forum. Looking forward to learning and sharing with you all.
  • Alexa problem

    4
    0 Votes
    4 Posts
    1k Views
    RussR
    @chrischickshow, that makes sense. I'll add something about that to the docs to warn people not to use the name of a room in their voice words..
  • TRIGGERcmd with Smarthings using Schema Cloud Connector

    smartthings
    5
    1 Votes
    5 Posts
    2k Views
    O
    @TheDreamer68!! It sounds like you're navigating the transition from the old Cloud Connected Device Integration to the new Schema Cloud Connector, which can be a bit tricky. Since the changeover is already happening, it’s best to follow the new path for creating integrations. If you’re stuck at step 14, it might be helpful to review any specific documentation or guides provided by SmartThings, especially around the Schema Cloud Connector setup.
  • TRIGGERcmd not starting at boot

    50
    1 Votes
    50 Posts
    20k Views
    Fabrizio HolsteinF
    @Russ yes, when I run manualy it start.
  • 1.0.47 not installing, no log

    4
    0 Votes
    4 Posts
    1k Views
    RussR
    @Xander, awesome. I'm glad that worked.
  • Powershell scripts no longer working

    6
    0 Votes
    6 Posts
    2k Views
    RussR
    @kellanist, great. That makes sense.
  • A JavaScript error occurred in the main process

    10
    1
    0 Votes
    10 Posts
    2k Views
    RussR
    @Tiago-Ivanov-Lavinas, great. Not sure what happened the first time, but renaming that folder is like a fresh agent install.
  • Install fails everytime, "JavaScript error in the main process.

    5
    1
    0 Votes
    5 Posts
    2k Views
    Tiago Ivanov LavinasT
    @Adam-S It worked. Thanks.
  • How to create a trigger

    3
    0 Votes
    3 Posts
    1k Views
    G
    @Russ Perfect! Thanks for your help!
  • Second Monitor Off

    1
    -1 Votes
    1 Posts
    755 Views
    No one has replied
  • Closing Apps created in Edge / Chrome Browsers

    4
    0 Votes
    4 Posts
    2k Views
    JRSF HomeJ
    I've found out a bit more about why the taskkill command does not always work. If there is more than one instance of the browser open, only the one that Windows perceives to be active shows up in the task list. So if the browser App is minimised or you switch focus to another browser window, it 'dissappears' from the task list and the taskkill command fails. Unfortunately I haven't found a workaround yet!
  • Command ran with error code 1 trying shutdown command

    2
    0 Votes
    2 Posts
    979 Views
    RussR
    @vitormbn , if you run the same command from a CMD window does it work? Error code 1 means it's running the command but it's failing. Ideally it will fail in the same way so you can see the error. One possible reason for the failure might be you don't have admin access on your machine.